secp256k1 Mathematical Range
The secp256k1 Mathematical Range
While any 256-bit number looks like a valid private key, there are strict mathematical boundaries defined by the secp256k1 Elliptic Curve. A number outside this range is invalid and cannot be used to sign transactions.
1. The Order of the Curve (n)
The "Size" of the secp256k1 curve is a specific prime number called n.
n = FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE BAAEDCE6 AF48A03B BFD25E8C D0364141 (Hex)
In decimal, this is approximately:
1.1579 \u00d7 10^77
2. Valid Key Range
A valid Bitcoin private key must be:
-
Greater than zero (0 is not a valid key).
-
Less than n (any number equal to or greater than
nwill "wrap around" or be mathematically invalid).
3. What happens if you go over?
If you pick a number larger than n, most libraries will perform a "Modulo" operation (Key % n). This means that two different 256-bit numbers could result in the same public key. To avoid confusion, standard wallets always check that the initial number is within the [1, n-1] range.
4. The Birthday Paradox and Collisions
Because the range n is so vast, the chance of two people picking the same private key by accident is virtually zero. Even if every human on Earth generated a trillion keys every second for the rest of the universe's life, the chance of a "Collision" (two people having the same key) remains effectively impossible.
5. Summary of the Range
| Attribute | Value |
|---|---|
| Minimum Valid Key | 0x0000000000000000000000000000000000000000000000000000000000000001 |
| Maximum Valid Key | 0xFFFFFFFF...BAAEDCE6AF48A03BBFD25E8CD0364140 |
| Total Combinations | ~2^256 |
NEVER REVEAL YOUR KEY. Even though there are 2^256 possibilities, if you leak your key, the "Range" doesn't matter. The thief has the exact coordinate to your vault.
In the next section, we will visualize the Probability of someone brute-forcing your private key.
TeachMeBitcoin is an ad-free, open-source educational repository curated by a passionate team of Bitcoin researchers and educators for public benefit. If you found our articles helpful, please consider supporting our hosting and ongoing content updates with a clean donation: