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.

private key0x4c0883a6…a 256-bit numberpublic key0x04bfcab2…elliptic curve multiplyaddress0x9f2e…c41alast 20 bytes of keccakmillisecondslonger than the universe has existed
Each arrow is trivial one way and impossible the other.

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?

Choose one answer

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?

Choose one answer

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.