Read this lesson as text
ECDSA Digital Signatures
Cryptography · Axiom Academy
LESSON ECDSA Digital Signatures Understanding the Elliptic Curve Digital Signature Algorithm Before we can sign or verify messages, we need to establish the cryptographic parameters and generate our key pair. E : An elliptic curve equation y² = x³ + ax + b G : A base point (generator) on the curve n : The order of G (number of points generated by G) Private key (d): A random integer in [1, n-1] Public key (Q): Q = dG (scalar multiplication) To sign a message m, the signer (who knows the private key d) performs the following steps: Hash the message: Compute e = H(m) where H is a cryptographic hash function (like SHA-256) Generate ephemeral key: Pick a random integer k from [1, n-1] Compute R point: Calculate R = kG on the elliptic curve Extract r coordinate: Set r = R.x mod n (the x-coordinate of R) Compute s value: Calculate s = k⁻¹(e + dr) mod n Output signature: The signature is the pair (r, s) Anyone can verify the signature (r, s) on message m using only the public key Q: Hash the message: Compute e = H(m) using the same hash function Calculate u₁: Compute u₁ = es⁻¹ mod n Calculate u₂: Compute u₂ = rs⁻¹ mod n Compute verification point: Calculate P = u₁G + u₂Q Check validity: Accept the signature if P.x mod n = r Let's prove that a valid signature will always verify correctly: Substituting u₁ = es⁻¹ and u₂ = rs⁻¹: Since Q = dG (public key definition): From signing, we know s = k⁻¹(e + dr), so s⁻¹ = k/(e + dr):
This is the written version of the interactive lesson above. See the full Cryptography course.