<p>In Bitcoin, a private key is just a random number between 1 and 0xFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141. This number is derived from the order of the elliptic curve that Bitcoin uses, <a href="https://en.bitcoin.it/wiki/Secp256k1" rel="nofollow">secp256k1</a>. </p>

<p>Note that you don't have to have the most significant bit 2^255 set to be a valid Bitcoin private key, any number greater than or equal than 1 will work. Indeed, knowing that the most significant bit is set actually lessens the security of that private key, because it reveals some information about the key. You don't have to use some special key generator, in fact there are even tutorials on how to generate a private key with coin flips. The only requirement of a private key (other than being in the range outlined above), is that it be random (hard to guess). </p>

CC BY-SA 3.0
2016-05-20T00:29:57.180Z
2016-05-20T00:29:57.180Z
morsecoder
<p>[I read that there are private keys with lengths other than 256 bit. I only talk about 256 bit private keys here. Are other lengths even common and supported by popular wallets like Electrum?]</p>

<p>Let's say I generate a private key <code>privateKey0</code> using a key generator. Then I choose some number <code>n</code> ∈ [1, 10^10]. Given that <code>privateKey0</code>+<code>n</code> &lt; 2^256, will <code>privateKey1</code> := <code>privateKey0</code>+<code>n</code> be a good private key?</p>

<p>A good private key of course needs to be <strong>valid</strong> and <strong>as strong as one generated by a private key generator</strong>. This does not take into account that one of them being made publicly available can lead to the other one being publicly available. <strong>However, using both productively must not weaken their secrecy for the second one to be considered a good private key.</strong> So let's assume that their corresponding public keys and the addresses for these are generated and both of them receive some amount of money.</p>

<p>I don't know anything about Bitcoin private keys (but am aware that an instance of the wallet import format is just the result of an easy-to-do operation on a big number as described <a href="https://bitcoin.stackexchange.com/questions/8247/how-can-i-convert-a-sha256-hash-into-a-bitcoin-base58-private-key">here</a>). Do they have to have special mathematical properties or can I just choose any number ∈ [2^255, 2^256 - 1] and use it as a private key?</p>

<p><a href="https://bitcoinspakistan.com/blog/electrum-seed-explained/" rel="nofollow noreferrer">Some websites</a> say that you can just use a random number. Are there any disadvantages to this compared to using a key generator?</p>

<security><private-key>
Does the private key have special mathematical properties?
UTF-8
# Does the private key have special mathematical properties?

(Asked by: username_0 on 2016-05-19)

[I read that there are private keys with lengths other than 256 bit. I only talk about 256 bit private keys here. Are other lengths even common and supported by popular wallets like Electrum?]

Let's say I generate a private key `privateKey0` using a key generator. Then I choose some number `n` ∈ [1, 10^10]. Given that `privateKey0`+`n` < 2^256, will `privateKey1` := `privateKey0`+`n` be a good private key?

A good private key of course needs to be **valid** and **as strong as one generated by a private key generator**. This does not take into account that one of them being made publicly available can lead to the other one being publicly available. **However, using both productively must not weaken their secrecy for the second one to be considered a good private key.** So let's assume that their corresponding public keys and the addresses for these are generated and both of them receive some amount of money.

I don't know anything about Bitcoin private keys (but am aware that an instance of the wallet import format is just the result of an easy-to-do operation on a big number as described [here](https://bitcoin.stackexchange.com/questions/8247/how-can-i-convert-a-sha256-hash-into-a-bitcoin-base58-private-key)). Do they have to have special mathematical properties or can I just choose any number ∈ [2^255, 2^256 - 1] and use it as a private key?

[Some websites](https://bitcoinspakistan.com/blog/electrum-seed-explained/) say that you can just use a random number. Are there any disadvantages to this compared to using a key generator?

**Tags:** security, private-key


---

## 1 answers

### Answer by username_1 on 2016-05-20. Score: 2 | Accepted answer

In Bitcoin, a private key is just a random number between 1 and 0xFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141. This number is derived from the order of the elliptic curve that Bitcoin uses, [secp256k1](https://en.bitcoin.it/wiki/Secp256k1).

Note that you don't have to have the most significant bit 2^255 set to be a valid Bitcoin private key, any number greater than or equal than 1 will work. Indeed, knowing that the most significant bit is set actually lessens the security of that private key, because it reveals some information about the key. You don't have to use some special key generator, in fact there are even tutorials on how to generate a private key with coin flips. The only requirement of a private key (other than being in the range outlined above), is that it be random (hard to guess).


---

