[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). 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 say that you can just use a random number. Are there any disadvantages to this compared to using a key generator?

1 Answer 1


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.

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).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.