<p>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 <code>1</code> and <code>n - 1</code>, where <code>n</code> is the order of the generator point <code>G</code>. Bitcoin uses the secp256k1 curve whose generator has an order <code>n = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141</code>, which is almost <code>2^256</code>.</p>
<p>This means that the minimum value for a private key is <code>1</code> and the maximum is <code>0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364140</code>. If you use an integer outside of this range, taking the modulo <code>n</code> of that integer will give you a value that is in the valid range (except for multiples of <code>n</code> for which the modulo is zero).</p>

CC BY-SA 4.0
2020-08-20T00:07:56.217Z
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).
Pieter Wuille
CC BY-SA 4.0
2020-08-20T00:00:53.967Z
2020-08-20T02:18:22.840Z
2020-08-20T02:18:22.840Z
Ava Chow
<p>We know that: <strong>S(Secret-Scalar) x G(Generater Point-Point(X,Y)) = Public Key</strong></p>
<p>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?</p>

<public-key>
What can be bitcoin's secret can be at most and at least?
Efe
# What can be bitcoin's secret can be at most and at least?

(Asked by: username_0 on 2020-08-19)

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?

**Tags:** public-key


---

## 1 answers

### Answer by username_1 on 2020-08-20. Score: 4 | Accepted answer

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

> **Comments:**
> **username_2**: 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).  

---

