explainer · keys and elliptic curves
How a crypto key works, in six diagrams.
Every Bitcoin and Ethereum wallet is one secret number and one curve. No maths background needed: by the end you’ll know what a private key is, why the public key can’t be run backwards, and the one assumption all of it depends on.
1 · the big idea
A door that only opens one way
Your private key is just a random number, written d. Run it through a fixed recipe on a curve and out comes your public key, Q. You share Q with the world.
Going forward takes a laptop a fraction of a millisecond. Going backward, from Q to d, has no known shortcut. That gap is the entire security model.
2 · the curve
Adding points with a ruler
Bitcoin and Ethereum both use the curve y² = x³ + 7, named secp256k1. Its points have a strange kind of addition. Draw a line through two points and it hits the curve exactly once more. Flip that point across the horizontal axis and you have their sum.
Two points make a third
Line through P and Q, find the third crossing, flip it. That’s P + Q.
One point makes a second
To add P to itself, use the line that just touches the curve at P (the tangent). That’s 2P.
Repeat to multiply
“d · G” means adding G to itself d times. Doubling lets you jump: G, 2G, 4G, 8G… so even a 77-digit d takes only about 256 doublings.
3 · clock arithmetic
The real curve is scattered dots
Computers can’t store infinitely precise numbers, so the real system does all of this maths “on a clock”: every result wraps around a prime number, the way 13:00 wraps to 1 o’clock. The smooth curve turns into a cloud of dots with no visible pattern.
Here’s the same curve on a tiny clock of size 211. It has 199 points (counting a special “zero” point). Move the slider: that’s your private key. The highlighted dot is your public key. Notice how neighbouring keys land nowhere near each other.
Bitcoin’s real clock has 78 digits, not 3.
4 · the scale
Why guessing is hopeless
On the 211 clock, a computer finds a hidden key instantly by trying every option. The real curve has about 1.16 × 10⁷⁷ possible keys. The cleverest known method still needs roughly the square root of that: about 2¹²⁸ steps.
5 · key to address
From secret number to wallet address
Your address is a fingerprint (a hash) of your public key. Two different one-way steps sit between the secret and what people see. Here’s a fresh, real secp256k1 key, made in your browser right now and never sent anywhere.
- private key d
- —
- public key Q (compressed)
- —
- fingerprint SHA-256(Q)
- —
Demo only: a key shown on a web page is not safe to use. Bitcoin adds RIPEMD-160 after SHA-256; Ethereum takes the last 20 bytes of a Keccak-256 hash. The idea is the same.
6 · signing
Proving you own d without revealing it
To move funds, your wallet signs a message with d. Anyone can check the signature against Q, but the signature doesn’t give d away. This scheme is called ECDSA.
the catch
“No known shortcut” is not “no shortcut”
Nobody has proven that reversing Q = d·G is hard. It’s hard because many smart people have tried for about 40 years and failed. That’s evidence, not a guarantee. Three things could open the door:
Shor’s algorithm
A large enough quantum computer solves this exact problem quickly. That’s known for certain (Shor, 1994); the hardware just doesn’t exist yet. This is “Y2Q”.
A better classical attack
A new shortcut on an ordinary computer. Unlikely on any given day, but AI is now producing real results on problems that stumped mathematicians for decades.
Bad randomness or reused k
The maths holds but the code leaks. This is how keys are actually lost today, and AI is getting faster at finding these bugs too.
sources
Check our work
- SEC 2: Recommended Elliptic Curve Domain Parameters, v2 (secp256k1 definition)
- FIPS 186-5: Digital Signature Standard (ECDSA)
- NIST SP 800-57 Part 1 Rev. 5: 256-bit curves give about 128-bit security
- Shor, Polynomial-time algorithms for prime factorization and discrete logarithms on a quantum computer (1994/1997)
- Ethereum Yellow Paper: addresses from Keccak-256 of the public key
- BIP-340: Schnorr signatures for secp256k1 (on nonce generation)