A public key lets someone check a signature without learning the private key. ECDSA builds that check from elliptic-curve point arithmetic and a message hash. It signs a message; it does not encrypt it.
The signer and verifier share the curve parameters
, including base point and its prime order . The signer holds a private scalar and publishes . The verifier must obtain the right public key for the identity or account being checked.
Let be the integer derived from the message hash. If the hash is longer than the bit length of , ECDSA takes its leftmost bits to that length. Coordinate arithmetic uses the field modulus ; signature scalars use .
The signer chooses a secret scalar between and , then computes:
The signature is . If either value is zero, signing retries with another . See FIPS 186-5, §6.4.
The example below uses the tiny curve with of order . It exposes and for learning and takes directly, without hashing a message. Change or change the digest presented to the verifier.
These small numbers offer no security. Some choices of produce an invalid signature; the diagram leaves that failure visible instead of silently replacing the nonce.
After validating the public key and checking , the verifier computes:
Reject if . Otherwise accept when . The verifier uses the message, public key and signature; it does not need or . Public-key validation checks the curve and subgroup as well as rejecting the point at infinity. See SEC 1, §§3.2.2 and 4.1.4.
For an honestly generated signature, substitute and the signing equation:
The reconstructed point has the same horizontal coordinate, so the check succeeds. This proves correctness of the calculation; resistance to forgery also relies on the chosen group, hash and implementation. Tiny teaching groups can have accidental matches after a digest change.
If an attacker learns from a valid signature, rearranging the equation reveals the private key:
Reusing the same for two different digest values is also dangerous. Subtracting the two signing equations can reveal , then .
The two signatures below use the same teaching key. Switch off nonce reuse: the two equations no longer yield one shared .
8k₁ ≡ 11 + 10d2k₂ ≡ 12 + 10dA nonce can come from a suitable cryptographic random generator or a specified deterministic construction. RFC 6979 derives it from the private key and message hash; deterministic does not mean publicly predictable. A timestamp is not a substitute.
| Value | Purpose | Secret? |
|---|---|---|
| Curve-generation seed | Helps construct shared curve parameters | No |
| Private scalar | Determines a user's public key | Yes |
| Signing nonce | Determines the point used for a signature | Yes |
P-256 and secp256k1 can both be used with ECDSA. Passkeys
commonly use the former; Ethereum EOA transactions
use the latter. Their groups and encodings are not interchangeable.
Recovering a public curve seed's origin is therefore a different task from recovering a signing key. Curve Origins
follows that investigation.