Sub topic 2
How a Phrase Becomes Keys and Addresses
This chapter explains what happens between the 12 or 24 words you wrote down and the addresses your wallet shows. It assumes you already know the difference between a public address and a private key, and that you have used a software or hardware wallet. Knowing the mechanism helps you reason about backups. It explains why one phrase restores many accounts, why a typo is often caught, and why a passphrase produces a completely different wallet.
The big picture
A recovery phrase is not a password the wallet checks. It is an encoding of a large random number. Your wallet turns that number into a seed, and the seed into a tree of private keys. Every step is deterministic, so the same input always gives the same output on any compatible wallet.
Two standards do most of the work:
- BIP-39 defines how entropy becomes a word list and how the words become a seed.
- BIP-32 (hierarchical deterministic, or HD, wallets) defines how one seed becomes a tree of keys. Related standards, BIP-44, BIP-49, BIP-84 and BIP-86, define conventional paths in that tree.
BIP stands for Bitcoin Improvement Proposal. Many other blockchains reuse these standards, which is why one phrase can often back up several coins.
Step 1: Entropy becomes words
Entropy is randomness. A wallet generates 128 to 256 random bits. It then computes a SHA-256 hash of those bits and appends the first few bits of the hash as a checksum. The checksum length is the entropy length divided by 32.
The combined bits are cut into groups of 11. Each group is a number from 0 to 2047, which is an index into a fixed list of 2048 words. That is why each word carries 11 bits.
# Word count of a BIP-39 phrase from entropy size.
# Checksum length is entropy_bits / 32; each word encodes 11 bits.
for entropy_bits in (128, 160, 192, 224, 256):
checksum_bits = entropy_bits // 32
words = (entropy_bits + checksum_bits) // 11
print(f"{entropy_bits} bits entropy + {checksum_bits} checksum bits = {words} words")Running it prints:
128 bits entropy + 4 checksum bits = 12 words
160 bits entropy + 5 checksum bits = 15 words
192 bits entropy + 6 checksum bits = 18 words
224 bits entropy + 7 checksum bits = 21 words
256 bits entropy + 8 checksum bits = 24 words| Words | Entropy bits | Checksum bits |
|---|---|---|
| 12 | 128 | 4 |
| 15 | 160 | 5 |
| 18 | 192 | 6 |
| 21 | 224 | 7 |
| 24 | 256 | 8 |
A 12-word phrase has 128 bits of entropy. That is far beyond what anyone can guess by brute force, so 24 words is not "twice as safe" in any practical sense. The usual reason to choose 24 words is a larger safety margin, or a wallet or device that defaults to it.
What the checksum does and does not do
The checksum is the last few bits of the phrase. When you restore, the wallet recomputes the hash and compares. A single wrong word usually breaks the match, so the wallet can warn you. With a 12-word phrase there are only 4 checksum bits, so a random wrong word still passes about 1 time in 16. A passing checksum means the phrase is well-formed. It does not mean it is the phrase you originally backed up.
The following script uses the public test phrase from the BIP-39 test vectors. Never type a real phrase into a script or onto a networked computer.
# pip install mnemonic
# Use ONLY the well-known public test phrase below. Never type a real phrase into a script or onto a networked computer.
from mnemonic import Mnemonic
m = Mnemonic("english")
test_phrase = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"
print(m.check(test_phrase)) # True: valid words and valid checksum
bad_phrase = test_phrase.replace("about", "abandon")
print(m.check(bad_phrase)) # False: checksum no longer matchesThe words come from a list designed so that the first four letters identify each word uniquely. That is why some hardware wallets ask you to enter only the first four letters, and why engraved backups sometimes record only those four letters.
Step 2: Words become a seed
The words are not decoded back into entropy to make keys. Instead, BIP-39 runs the phrase text through PBKDF2, a key-stretching function. It uses HMAC-SHA512, 2048 rounds, and a salt made from the string "mnemonic" plus your optional passphrase. The output is a 512-bit seed.
Consequences of this design:
- The seed depends on the exact words as text. Spelling, order, and the word list matter.
- With no passphrase, the salt is just
"mnemonic", so every wallet computes the same seed from the same phrase. - With a passphrase, the salt changes, and the seed is completely different. There is no error. The wallet simply opens a different, valid-looking wallet. The passphrase chapter covers the trade-offs.
- The 2048 rounds add a small cost for an attacker testing guesses. They do not make a weak passphrase strong.
Step 3: One seed becomes a tree of keys
BIP-32 takes the 512-bit seed and runs it through HMAC-SHA512 to produce a master private key and a chain code. The chain code is extra data that lets the wallet derive children deterministically. From the master key the wallet can derive child keys, and from each child more children, forming a tree.
Each position in the tree is described by a derivation path, such as:
m / 84' / 0' / 0' / 0 / 0Read it left to right:
| Part | Meaning |
|---|---|
| `m` | The master key |
| `84'` | Purpose: which address standard (BIP-84, native SegWit) |
| `0'` | Coin type: 0 is Bitcoin, 60 is Ethereum |
| `0'` | Account number: first account |
| `0` | Chain: 0 for receiving addresses, 1 for change |
| `0` | Address index: first address |
The apostrophe marks a hardened derivation. A hardened child cannot be derived from a parent public key alone, which limits damage if an account-level public key leaks. Hardened steps still need the parent private key, so the seed remains the root of everything.
From private key to address
Each leaf private key produces a public key by elliptic-curve multiplication, which is a one-way operation. The address is then computed from the public key by hashing and encoding. The format depends on the coin and standard, which is why the same phrase gives a different address for Bitcoin and Ethereum. Nothing in this chain can be run backward. An address reveals nothing about the phrase.
Why this design matters for backups
- One backup covers everything. Future addresses are derived, not stored. You back up the phrase once, and later addresses are recovered automatically.
- Wallets are interchangeable. Any wallet that follows the same standards and paths regenerates the same keys. You are not tied to one vendor.
- The phrase is the root, not a derived key. Whoever has the phrase can derive every private key under it, for every coin and account. This is why exposure of the phrase is total, not partial.
- Restoring requires the right path. The words alone are not always enough. If a wallet uses a non-standard derivation path, restoring in another wallet can show an empty balance even though the funds are safe. Record the wallet name and any custom path or account details separately from the words, ideally with the backup.
Common errors
- Believing the words are the key. The words are an encoding of entropy that is stretched into a seed. A different word list language or a re-ordered phrase gives a different wallet.
- Treating the checksum as proof. A valid checksum means the phrase is well-formed. Always confirm by checking that a restore shows the first receiving address you expect.
- Assuming every phrase is BIP-39. Some wallets use other schemes, such as Electrum's native seed format, which looks similar but is not compatible. Check what your wallet uses before assuming a backup will work elsewhere.
- Forgetting the passphrase. A passphrase is not stored in the phrase. Losing it makes the funds in that wallet unrecoverable.
- Ignoring the legacy of a 12-word safety question. Twelve words is fine if generated with good randomness. The danger is bad randomness, not a short phrase. This is why the next chapters stress generating the phrase on a trusted device.
Exercise
A friend restores their 12-word phrase in a new wallet. The words are accepted with no checksum warning, but the balance shows zero. Give two plausible causes that do not involve lost funds, and say what you would check first.
Show answer
Likely causes are a different derivation path or address type (for example BIP-44 versus BIP-84), or an optional passphrase that was used in the original wallet. A checksum pass only shows the phrase is well-formed, not that it matches the original. First check that every word was entered exactly and in order, then check whether the original wallet used a passphrase, then try the address type or path the original wallet used. Do not paste the phrase into a website to investigate.
Exercise
A 24-word phrase has 256 bits of entropy. How many checksum bits does it have, how many total bits are encoded, and why does that equal 24 words?
Show answer
The checksum is 256 / 32 = 8 bits. The total is 256 + 8 = 264 bits. Each word encodes 11 bits, and 264 / 11 = 24 words.