Cryptography

Private & public keys

Public-key cryptography is the idea that lets you own Bitcoin. You have two linked keys: a private key you keep utterly secret, and a public key you can hand to the world. What one locks, only the other can unlock — and you can’t work the secret one out from the public one.

A secret and a name

  • Private key — a gigantic random number that only you know. It’s the master key to your money. Whoever holds it controls the funds; lose it and they’re gone forever.
  • Public key — derived from the private key by a one-way calculation. You can publish it freely. Your Bitcoin address is essentially a public key; it’s how people send you money.

The one-way link is everything. Deriving the public key from the private key is easy. Reversing it — recovering the private key from the public key — is, as far as anyone knows, impossible, even with all the world’s computers. That asymmetry is a trapdoor, and it’s built from the elliptic-curve maths in the last lesson of this section.

A lock with two different keys

Ordinary locks use one key to lock and unlock. Public-key crypto uses a matched pair that work in opposite directions:

  • Anyone can lock a message with your PUBLIC key, and only your PRIVATE key can open it — that’s encryption (sending you a secret).
  • You can lock something with your PRIVATE key, and anyone can verify it with your PUBLIC key — that’s a signature (proving it came from you). This second use is how Bitcoin works.

Not your keys, not your coins

This is the deepest break from every money system in the History section. There, your money lived in someone else’s ledger and you trusted them to honour it. With keys, ownership is just knowledge: hold the private key and you can move the coins yourself, with no bank’s permission. That’s what “self-custody” means — and why the phrase “not your keys, not your coins” is a warning about letting an exchange hold your private keys for you.

Owning a key is one thing; using it to authorise a specific payment without ever revealing it is another. That’s the job of a digital signature — next.

Spotted an error or have feedback on this lesson? Suggest a correction ↗

Comments

Powered by Nostr — reply from any Nostr client, and zap the lesson over Lightning.