# How does ECDSA work when generating the public key?

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?

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

Indeed the elliptic curve used in Bitcoin is 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 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).