The Elliptic Curve Digital Signature Algorithm (ECDSA) is a method for creating and checking digital signatures using the mathematics of elliptic curves. A signer holds a secret private key and publishes a matching public key; anyone can use the public key to confirm that a message was signed by the holder of the private key and has not been altered, without learning the private key itself. ECDSA is the scheme that Bitcoin and Ethereum use to authorise transactions, on a curve called secp256k1.
ECDSA is the elliptic-curve version of the older Digital Signature Algorithm (DSA). Its appeal is efficiency: a 256-bit elliptic-curve key gives security broadly comparable to a far larger RSA key, so keys and signatures are short, which matters when every signature is stored on a blockchain. It is standardised by bodies including ANSI and the US National Institute of Standards and Technology, and is also widely used in web certificates and secure messaging.
How signing and verification work
A private key is a large random number . The public key is a point on the curve, found by "multiplying" a fixed base point by . Going from to is easy, but recovering from is believed to be infeasible with ordinary computers; this is the elliptic curve discrete logarithm problem, the basis of the scheme's security.
To sign, the signer hashes the message with a cryptographic hash function to get a number , picks a secret one-time nonce , computes the point and takes its x-coordinate modulo as . The second half of the signature is:
- is the order of the base point, a fixed large prime for the curve.
- is the inverse of the nonce modulo .
- and together form the signature.
A verifier computes and , both modulo , and then the point:
The signature is valid if the x-coordinate of , taken modulo , equals . Real-world values are 256-bit numbers, so the arithmetic is done only by software.
Use in Bitcoin and Ethereum
Bitcoin has used ECDSA over secp256k1 since its launch in 2009. The curve, defined by the Standards for Efficient Cryptography Group, has the simple equation , which allows fast computation. Each transaction input carries a signature proving the spender controls the key behind the coins, and an address is derived by hashing the public key. Because a valid ECDSA signature can be altered into a second valid form, Bitcoin adopted a "low-S" rule, and SegWit moved signatures out of the transaction ID to fix the resulting malleability problem.
The Ethereum blockchain uses the same curve but adds a small recovery value to each signature, so nodes can recover the sender's public key from the signature itself; the account address is the last 20 bytes of the Keccak-256 hash of that key. Structured signing standards such as EIP-712 still rely on ECDSA underneath.
Nonce reuse and implementation risks
ECDSA is unforgiving of mistakes in choosing . If the same nonce is used to sign two different messages with one key, or if the nonce is predictable, anyone who sees both signatures can solve for the private key with simple algebra. This flaw was behind the 2010 break of the signing key for the Sony PlayStation 3, and in 2013 a weakness in a random number generator on Android led to thefts from some Bitcoin wallets that had produced repeated nonces.
To avoid this, most modern libraries derive the nonce deterministically from the private key and message, as set out in RFC 6979, instead of relying on fresh randomness. Hardware wallets and hardware security modules also guard against side-channel attacks that try to extract keys from timing or power use.
Comparison with Schnorr signatures
Schnorr signatures, an older design long held back by a patent, work on the same curves but have a simpler, linear structure. That makes them easier to prove secure, allows several signatures to be verified in a batch and lets multiple keys be combined into one, which helps multisignature schemes look like ordinary single-key payments. Bitcoin added Schnorr signatures through BIP-340 as part of the Taproot upgrade, activated in November 2021; ECDSA remains valid for older outputs. Ethereum still uses ECDSA for accounts, while some newer chains use the EdDSA family instead.
Like other elliptic-curve schemes, ECDSA would be broken by a large enough quantum computer running Shor's algorithm. This is the main driver of research into post-quantum cryptography for blockchains, although no such machine exists today.
External links
Ref 1070001159