Track 2 · Keys & identity · lesson 2
Public keys and the one-way trip
7 min
Your private key never leaves your device. So how does anyone verify anything you sign?
Because the key has a public counterpart, derived from it, that gives nothing away.
The one-way trip
Multiply your private key by a fixed point on the secp256k1 elliptic curve and you get your public key. Milliseconds.
Going backwards means solving the discrete logarithm problem, and nobody knows how to do that in less time than the universe has existed.
You met this shape in track 0 with hashing: easy forwards, hopeless backwards. It is the same idea with different mathematics.
Hashing throws information away, so reversing it is meaningless. Elliptic curve multiplication keeps all the information — the private key is genuinely recoverable in principle. It is just computationally out of reach, which turns out to be enough.
Predict
Given someone's public key, how hard is it to find their private key?
Why you rarely see a public key
Ethereum shows you addresses, not public keys. The address is the last 20 bytes of the keccak hash of the public key — an extra one-way step on top.
The public key is not published anywhere until you sign something. And then it does not need to be, because of a neat property covered next lesson: a signature lets anyone recover the signing address, so you never have to supply it.
Check
Why derive an address from the public key rather than just using the public key?
Worth remembering
- The public key is derived from the private key by elliptic curve multiplication on secp256k1.
- Forwards takes milliseconds; backwards is the discrete logarithm problem and computationally out of reach.
- Unlike hashing, the private key is determined by the public key — unreachable, not destroyed.
- An Ethereum address is the last 20 bytes of the keccak hash of the public key.