<p>A bitcoin private key is a number greater than or equal to 1 and less than X, where:</p>

<pre><code>X = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141
</code></pre>

<p>That's in base 16. In normal base 10 numbers, that's:</p>

<pre><code>X = 115792089237316195423570985008687907852837564279074904382605163141518161494337
</code></pre>

<p>Any number outside of that range is an invalid private key. That includes 0 and X, X+1, X+2, ...</p>

CC BY-SA 3.0
2016-07-09T10:55:08.253Z
It is true that any number outside that range is invalid. The question is more about numbers inside the range. Is it possible to find, or are there any known number **inside** the range that is invalid?
John Smith
CC BY-SA 3.0
2016-07-25T12:28:04.660Z
@XRSC All numbers in that range are valid. The quote in your question is alluding to the fact that there are some numbers that fit within 256 bits that are greater than or equal to X still, so not every 256 bit number is a valid private key. X itself, for example.
morsecoder
CC BY-SA 3.0
2016-07-08T17:28:15.120Z
2016-07-08T17:28:15.120Z
morsecoder
<p>&quot;1.2288e66 invalid values&quot; is wrong</p>
<pre><code>  FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
- EBAAEDCE6AF48A03BBFD25E8CD0364140
= 14551231950B75FC4402DA1732FC9BEBF (base16)
= 432 420 386 565 659 656 852 420 866 394 968 145 599 (base10) +1 (Key 0x00) 
= 432 420 386 565 659 656 852 420 866 394 968 145 600
= 4.3242e38 invalid values

  1,1579208923731619542357098500869e+77 max values (2^256)
- 4,3242038656565965685242086639497e+38 invalid values
= 1,1579208923731619542357098500869e+77 valid values :D (change not visible)
</code></pre>

CC BY-SA 4.0
2024-09-22T19:48:02.640Z
2024-09-22T19:49:07.740Z
2024-09-22T19:49:07.740Z
Hui
<p>From <a href="https://www.reddit.com/r/Bitcoin/comments/1rurll/on_the_subject_of_listing_all_possible_private/" rel="nofollow">here</a>, we can read that : </p>

<blockquote>
  <p>A private key is a 256-bit value, meaning there are approximately
  1.1579e77 possible keys (There are about 1.2288e66 invalid values</p>
</blockquote>

<p>But <a href="https://en.bitcoin.it/wiki/Private_key" rel="nofollow">here</a>, we have : </p>

<blockquote>
  <p>Nearly every 256-bit number is a valid ECDSA private key.
  Specifically, any 256-bit number from 0x1 to 0xFFFF FFFF FFFF FFFF
  FFFF FFFF FFFF FFFE BAAE DCE6 AF48 A03B BFD2 5E8C D036 4140 is a valid
  private key.</p>
</blockquote>

<p>Does "nearly every" mean (1.1579e77-1.2288e66) out of 1.1579e77 ?</p>

CC BY-SA 3.0
2016-07-08T16:16:59.893Z
The answer is right there in the passage you quoted.  "Any 256-bit number from 0x1 to 0xFFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFE BAAE DCE6 AF48 A03B BFD2 5E8C D036 4140 is a valid private key."  So for instance, 0x0 and 0xFFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFE BAAE DCE6 AF48 A03B BFD2 5E8C D036 4141 are not valid private keys.  You can read https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm to see why; the key must be less than `n`, the size of the group.
Nate Eldredge
CC BY-SA 3.0
2016-07-09T01:02:04.147Z
The count of invalid on reddit is wrong, it should be about 4.32420e38. But either of these is small compared to 1.15972e77, hence 'nearly every'.
dave_thompson_085
<private-key>
How a private key can be invalid?
John Smith
# How a private key can be invalid?

(Asked by: username_0 on 2016-07-08)

From [here](https://www.reddit.com/r/Bitcoin/comments/1rurll/on_the_subject_of_listing_all_possible_private/), we can read that :

> A private key is a 256-bit value, meaning there are approximately
> 1.1579e77 possible keys (There are about 1.2288e66 invalid values

But [here](https://en.bitcoin.it/wiki/Private_key), we have :

> Nearly every 256-bit number is a valid ECDSA private key.
> Specifically, any 256-bit number from 0x1 to 0xFFFF FFFF FFFF FFFF
> FFFF FFFF FFFF FFFE BAAE DCE6 AF48 A03B BFD2 5E8C D036 4140 is a valid
> private key.

Does "nearly every" mean (1.1579e77-1.2288e66) out of 1.1579e77 ?

**Tags:** private-key

> **Comments:**
> **username_1**: The answer is right there in the passage you quoted.  "Any 256-bit number from 0x1 to 0xFFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFE BAAE DCE6 AF48 A03B BFD2 5E8C D036 4140 is a valid private key."  So for instance, 0x0 and 0xFFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFE BAAE DCE6 AF48 A03B BFD2 5E8C D036 4141 are not valid private keys.  You can read https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm to see why; the key must be less than `n`, the size of the group.  
> **username_2**: The count of invalid on reddit is wrong, it should be about 4.32420e38. But either of these is small compared to 1.15972e77, hence 'nearly every'.  

---

## 2 answers

### Answer by username_3 on 2016-07-08. Score: 2

A bitcoin private key is a number greater than or equal to 1 and less than X, where:

```
X = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141

```

That's in base 16. In normal base 10 numbers, that's:

```
X = 115792089237316195423570985008687907852837564279074904382605163141518161494337

```

Any number outside of that range is an invalid private key. That includes 0 and X, X+1, X+2, ...

> **Comments:**
> **username_0**: It is true that any number outside that range is invalid. The question is more about numbers inside the range. Is it possible to find, or are there any known number **inside** the range that is invalid?  
> **username_3**: @XRSC All numbers in that range are valid. The quote in your question is alluding to the fact that there are some numbers that fit within 256 bits that are greater than or equal to X still, so not every 256 bit number is a valid private key. X itself, for example.  

---

### Answer by username_4 on 2024-09-22. Score: 0

"1.2288e66 invalid values" is wrong

```
  FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
- EBAAEDCE6AF48A03BBFD25E8CD0364140
= 14551231950B75FC4402DA1732FC9BEBF (base16)
= 432 420 386 565 659 656 852 420 866 394 968 145 599 (base10) +1 (Key 0x00) 
= 432 420 386 565 659 656 852 420 866 394 968 145 600
= 4.3242e38 invalid values

  1,1579208923731619542357098500869e+77 max values (2^256)
- 4,3242038656565965685242086639497e+38 invalid values
= 1,1579208923731619542357098500869e+77 valid values :D (change not visible)

```


---

