We know that: S(Secret-Scalar) x G(Generater Point-Point(X,Y)) = Public Key

In bitcoin, what is the range of that secret can be? What can it be at most and at least? Is there a limit to it like 2^256? If yes what is the logic behind that too?


The maximum and minimum private key possible is defined by ECDSA and the curve being used. In ECDSA, the private key is an integer between 1 and n - 1, where n is the order of the generator point G. Bitcoin uses the secp256k1 curve whose generator has an order n = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141, which is almost 2^256.

This means that the minimum value for a private key is 1 and the maximum is 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364140. If you use an integer outside of this range, taking the modulo n of that integer will give you a value that is in the valid range (except for multiples of n for which the modulo is zero).

  • 1
    Pedantic nit: if you use an integer that is a multiple of n, taking the modulus with n will not give you a valid value (but any other integer will work). Aug 20 '20 at 0:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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