Current Block Height

-------

Moscow Time

--:--

Canadian Debt

Live ↗

Keys & Addresses

The cryptography behind owning Bitcoin

We keep saying "not your keys, not your coins." This guide is about what those keys actually are. Owning Bitcoin really means knowing a secret number. Everything else (your public key, your addresses, your signatures) flows from it in one direction. Once you see that chain, a lot of Bitcoin clicks into place.

Your Private Key: One Enormous Number

A private key is, at heart, just a randomly generated 256-bit number: any whole number from 1 up to about 1.16 × 1077. That's a number with 77 digits, comparable to the number of atoms in the observable universe. The space is so unimaginably vast that two people generating keys will never collide, and no one can guess yours.

Whoever knows the private key controls the coins. That's why it must stay secret, and why you never type it anywhere. In practice you'll rarely see it: your wallet generates and stores it for you, derived from your recovery phrase (more on that below). For a closer look at that number, where it comes from and the forms it takes, see Private Keys.

Your Public Key: Derived, Not Chosen

From your private key, your wallet computes a matching public key using elliptic-curve cryptography on a specific curve called secp256k1. The magic is that this is a one-way function: it's trivial to go from private key to public key, but, even with all the computers on Earth, effectively impossible to work backwards.

That asymmetry is the whole trick. You can hand out your public key freely; it reveals nothing about the private key that produced it. (Public keys come in a compressed form of ~66 hex characters, which modern wallets use, and an older uncompressed ~130-character form, with the same security.) For the math behind it, see Public Keys.

From Public Key to Address

An address is one more step removed. Your wallet takes the public key and hashes it, running it through SHA-256 and then RIPEMD-160 (together called HASH160), and then encodes the result into the friendly string you share, complete with a built-in checksum so typos get caught.

Why add hashing? Three reasons: the address is shorter and easier to handle, the checksum protects against errors, and it adds another one-way layer: your public key isn't even revealed on-chain until you actually spend. It's defense in depth, for free.

The Flavours of Address

The encoding step is why addresses come in different shapes:

When a wallet offers the choice, prefer a bc1 address. They have lower fees and better error detection. (We touch on this in Using Bitcoin as Money.)

A One-Way Street

So the whole chain runs in a single direction:

private key → public key → address

You can never run it backwards, not from an address to a public key, nor from a public key to a private key. This is what makes self-custody both powerful and unforgiving: share your address all day long, but if you lose the private key (your seed), the coins are gone. There's no reset.

It's also how spending works without ever exposing your secret. To send coins, your wallet uses the private key to produce a signature over the transaction. Anyone can verify that signature against your public key, proving the coins are yours to move, yet the key itself never leaves your device.

HD Wallets: One Seed, Endless Keys

Managing one private key per coin would be a nightmare. So modern wallets are hierarchical deterministic (HD): your recovery phrase (a 12- or 24-word seed) is the master from which all of your keys and addresses are generated, in a predictable tree.

That tree is navigated by a derivation path, something like m/84'/0'/0'/0/0, where standardized levels (BIP32 for the tree, BIP39 for the words, BIP44/84/86 for the layout) decide which key you get. The upshot for you: a wallet can hand out a fresh address for every payment, and yet every one of them can be recovered from that single seed.

One more useful trick: an extended public key (xpub) lets a wallet generate all your addresses without any ability to spend. That's how a watch-only wallet works: your phone can track the balance of your cold-storage wallet while the private keys stay safely offline.

Why the Seed Is Everything

Now you can see why every guide hammers the same point. Your recovery phrase isn't a backup. It's the root of the entire tree, the one secret that can regenerate every key and every address you'll ever use. Protect it like it is your Bitcoin, because it is: written on paper then metal, never a photo or a cloud file, never shared with anyone.

Put it to work. See how keys move coins in Using Bitcoin as Money, how the network checks those signatures in The Bitcoin Network, and how to keep your seed safe on Choosing a Wallet.