<blockquote>
<p>What is secp256k1, is it the curve that is always used</p>
</blockquote>
<p>Indeed the elliptic curve used in Bitcoin is <a href="https://en.bitcoin.it/wiki/Secp256k1" rel="nofollow noreferrer">secp256k1</a> which is the curve defined using <code>a=0</code> and <code>b=7</code> in your equation <code>mod p</code>. But other curves are used for other use cases (maybe other cryptocurrencies too, not sure).</p>
<blockquote>
<p>does it generate the field in order to generate a new curve.</p>
</blockquote>
<p>No the curve stays the same. The field size <code>p</code> is implicitly defined by the curve. In secp256k1's case <code>p = 2^256 - 2^32 - 977</code> or <code>p = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F</code> in hex and is prime.</p>
<p>The generator point G (on the curve) is (Gx, Gy) where</p>
<p><code>Gx=0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798</code></p>
<p><code>Gy=0x483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8</code></p>
<p>The curve order (how many points there are on the curve) of secp256k1 is:</p>
<p><code>n = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141</code></p>
<p>For more details see Jimmy Song's first three chapters of his <a href="https://github.com/jimmysong/programmingbitcoin" rel="nofollow noreferrer">book</a> Programming Bitcoin.</p>
<p>The question in the title asks about generating the public key. That is calculated by effectively multiplying the generator point G (coordinates) by the private key (scalar).</p>

CC BY-SA 4.0
2022-06-18T12:53:26.413Z
2022-06-18T13:08:34.070Z
2022-06-18T13:08:34.070Z
Michael Folkson
<p>I know the curve has formula <code>y^{2}=x^{3}+ax+b</code>. However, some websites are saying that <code>a=0</code> and <code>b=7</code> for secp256k1?</p>
<p>What is secp256k1? Is it the curve that is always used or does it generate the field in order to generate a new curve?</p>

<wallet><private-key><public-key><ecdsa><secp256k1>
How does ECDSA work when generating the public key?
Jamo
# How does ECDSA work when generating the public key?

(Asked by: username_0 on 2022-06-18)

I know the curve has formula `y^{2}=x^{3}+ax+b`. However, some websites are saying that `a=0` and `b=7` for secp256k1?

What is secp256k1? Is it the curve that is always used or does it generate the field in order to generate a new curve?

**Tags:** wallet, private-key, public-key, ecdsa, secp256k1


---

## 1 answers

### Answer by username_1 on 2022-06-18. Score: 2

> What is secp256k1, is it the curve that is always used

Indeed the elliptic curve used in Bitcoin is [secp256k1](https://en.bitcoin.it/wiki/Secp256k1) which is the curve defined using `a=0` and `b=7` in your equation `mod p`. But other curves are used for other use cases (maybe other cryptocurrencies too, not sure).

> does it generate the field in order to generate a new curve.

No the curve stays the same. The field size `p` is implicitly defined by the curve. In secp256k1's case `p = 2^256 - 2^32 - 977` or `p = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F` in hex and is prime.

The generator point G (on the curve) is (Gx, Gy) where

`Gx=0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798`

`Gy=0x483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8`

The curve order (how many points there are on the curve) of secp256k1 is:

`n = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141`

For more details see Jimmy Song's first three chapters of his [book](https://github.com/jimmysong/programmingbitcoin) Programming Bitcoin.

The question in the title asks about generating the public key. That is calculated by effectively multiplying the generator point G (coordinates) by the private key (scalar).


---

