Keys and addresses
How Bitcoin keys and addresses work: a private key becomes a public key, then a hash, then an address. Read this section in order.
By Dimitar Zurnov · Updated 4 Nov 2026
Adapted from Learn Me a Bitcoin by Greg Walker.
Bitcoin keys are the numbers that control coins. A private key is a secret random number. The public key, the public key hash and the address are each made from the one before, in a single direction. The steps cannot be reversed in practice, so an address does not reveal its private key.
Owning coins means being able to sign for them. Coins are locked to a public key, or to a hash of one. To spend them, you show a signature that only the private key could make. Anyone can check that signature, but nobody can forge it.
How do the keys connect?
Each arrow is one step. The elliptic curve step and the hash steps are one-way, so you can go down the chain but not back up it.
What is a private key?
A private key is a secret number, picked at random from a 256-bit range, and it is the only secret in the chain. Keep it offline, back it up, and never share it. The full page is private key.
What is a public key?
A public key is a point on the secp256k1 curve, calculated from the private key with elliptic curve maths. Most public keys are compressed: 33 bytes, made of a prefix of 02 or 03 and the 32-byte x coordinate. The prefix records whether the y coordinate is even or odd. An uncompressed key is 65 bytes and starts with 04. Taproot outputs use a 32-byte x-only key, defined in BIP 340.
What is a public key hash?
A public key hash is the 20-byte result of HASH160: SHA-256, then RIPEMD-160. It is shorter than the public key, and legacy and SegWit addresses both carry it. The public key hash page explains how it is made.
What is an address?
An address is a human-friendly encoding of the public key hash, with a type byte and a checksum added. Legacy addresses use Base58 and start with 1, or 3 for P2SH. SegWit addresses use bech32, defined in BIP 173, and start with bc1q. Taproot addresses start with bc1p and use bech32m, defined in BIP 350. The address type tells the wallet which kind of lock to build. See address for the details.
Which order should you read this section in?
Read the pages in this order. Each one builds on the ones before it.
- Private key: the secret number at the root of every key.
- WIF private key: a private key written in Base58, with a network byte and a checksum.
- Public key: the curve point made from the private key, in its compressed and uncompressed forms.
- Public key hash: the 20-byte hash that most addresses carry.
- Checksum: how a few extra bytes catch a typing error.
- Base58: the alphabet that leaves out 0, O, I and l.
- Bech32: the encoding for SegWit and Taproot addresses.
- Address: how the chain ends in an address you can pay.
- Signature: how the private key proves ownership without being revealed.
- HD wallets: how one seed produces a tree of keys.
- Mnemonic seed: the words that back up that seed.
- Extended keys: the
xpubandxprvformats for branches of the tree. - Derivation paths: how a wallet names each key in the tree.
Once you have the chain in mind, try it on a real address. Our explorer reads each address from our own node, and address explains what you see there.
In this section
- 1Private keyHow a Bitcoin private key is generated: 32 random bytes shown as 64 hex digits, a valid range from 1 to n-1, and secure randomness.
- 2WIF private keyWIF private key format: Wallet Import Format writes a Bitcoin private key in Base58, with a network byte and a checksum. Learn to encode and decode it.
- 3Public keyHow a Bitcoin public key is made from a private key on the secp256k1 curve, and its compressed, uncompressed and x-only forms.
- 4Public key hashA Bitcoin public key hash is the 20-byte HASH160 of a public key, made with SHA-256 then RIPEMD-160. See how it is made and where it appears.
- 5ChecksumA Bitcoin checksum is the first 4 bytes of a double SHA-256 hash, added to addresses and keys so that typing mistakes get caught. Learn how it works.
- 6Base58Base58 encoding in Bitcoin: a 58-character alphabet with no 0, O, I or l, used for legacy addresses, WIF keys and extended keys.
- 7Bech32Bech32 addresses in Bitcoin: the bc1 format for SegWit and Taproot, with one letter case, a 32-character alphabet and a stronger checksum.
- 8AddressThe bitcoin address format is a short, checksummed code for a locking script. Compare the five types, 1, 3, bc1q and bc1p, and see how each is built.
- 9SignatureA Bitcoin signature proves you hold a private key without revealing it. Learn how a transaction is signed, DER encoding, sighash flags and low S.
- 10HD walletsA bitcoin HD wallet makes a whole tree of keys from one seed, as BIP 32 describes. Learn how the master key, child keys and public-only derivation work.
- 11Mnemonic seedA bitcoin seed phrase is 12 to 24 words, per BIP 39, that encode random entropy with a checksum. Learn how the words make the seed and what a passphrase does.
- 12Extended keysA bitcoin xpub is an extended public key: a public key plus a chain code that makes child keys. Learn how xpub and xprv are built, and the risks.
- 13Derivation pathsA derivation path such as m/84'/0'/0'/0/0 finds one key in an HD wallet. Learn what each level means, and how BIP 44, 49, 84 and 86 differ.
Something look wrong? Tell us