Sub topic 11
The optional passphrase and its trade-offs
This chapter assumes you already know what a BIP-39 recovery phrase is, how it maps to keys and addresses, and how to write down and store a backup. Here you will learn what the optional passphrase (often called the "25th word") does, what it protects against, and how it can destroy access to your funds if you handle it badly.
What the passphrase is
A BIP-39 passphrase is an extra piece of text that you choose. The wallet combines it with your recovery phrase when it creates the seed, the number from which all your keys are derived. The passphrase is not one of the 12 or 24 words, and it is not stored in the phrase's checksum. It can be any text: a word, a sentence, or random characters.
The wallet turns the phrase and the passphrase into a seed with a key-stretching function called PBKDF2. The phrase is the input. The text "mnemonic" plus your passphrase is the salt, which is a value mixed in so that different inputs give unrelated outputs.
import hashlib
phrase = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"
def seed_hex(phrase: str, passphrase: str = "") -> str:
seed = hashlib.pbkdf2_hmac(
"sha512",
phrase.encode("utf-8"),
("mnemonic" + passphrase).encode("utf-8"),
2048,
)
return seed.hex()
print(seed_hex(phrase)[:32])
print(seed_hex(phrase, "correct horse")[:32])
print(seed_hex(phrase, "correct horsf")[:32])This script uses the public test phrase only. Never type a real phrase into a script. Running it prints three unrelated values. Changing one letter of the passphrase gives a completely different seed.
Hidden wallets, not wrong passwords
Most passwords work like a lock. A wrong guess is rejected. A BIP-39 passphrase does not work that way. The wallet never checks the passphrase against anything, because nothing stored anywhere can confirm it. Any passphrase produces a valid seed, and that seed produces valid keys and addresses.
This has two consequences:
- Every passphrase opens a different wallet. The empty passphrase opens the "standard" wallet. The passphrase
"blue"opens another one."Blue"opens a third. - A typo does not produce an error. It produces an empty wallet with a new, correct-looking address.
What the passphrase protects against
The passphrase changes the threat model from the earlier chapter. It adds protection against one specific problem: someone finds the written phrase but not the passphrase.
| Threat | Phrase only | Phrase plus passphrase |
|---|---|---|
| Burglar finds your steel backup | Funds stolen | Burglar sees only the standard wallet, which may be empty or hold a small amount |
| Someone photographs your paper once | Funds stolen | Funds stay safe if the passphrase was never near the photo |
| Coercion ("give me your funds") | You must hand over everything | You can reveal a decoy wallet with the empty passphrase |
| Fire destroys your backup | Funds lost | Funds lost, and the passphrase adds a second thing to lose |
| You forget where the backup is | Funds lost | Same |
The passphrase helps with theft and coercion. It does not help with loss or damage. It makes both of those worse, since you now have two secrets to keep alive instead of one.
Why a passphrase can also be dangerous
Three failure modes cause most passphrase losses.
- Forgetting it. There is no recovery process. The passphrase is not stored on the device, in the phrase, or on any server. If nobody remembers it, the hidden wallet is gone.
- Typing it differently. Case, spaces, punctuation, and language keyboard layouts all matter. A trailing space is part of the passphrase. Unicode text can be normalized differently by different software, so non-ASCII characters can produce different seeds on different wallets. Stick to plain ASCII unless you have tested restoring on every wallet you might use.
- Making the secret unreachable for heirs. If only you know it, your family cannot recover the funds after your death. The inheritance chapter covers this.
Passphrase loss is usually permanent. Treat it with the same care as the phrase itself.
Choosing a good passphrase
A passphrase has two jobs that pull in different directions. It must be hard to guess, and it must be something you can reproduce exactly years later.
- Length beats cleverness. A random string of several unrelated words is strong and easier to remember than symbols. Four or more randomly chosen words is a reasonable floor. Pick them with dice or a generator, not by thinking of a favorite quote.
- Avoid anything personal. Names, birthdays, pet names, and song lyrics can be guessed or found online.
- Avoid short passphrases. An attacker who has your phrase can try guesses offline, at the speed of their own hardware, with no lockout. PBKDF2 with 2048 rounds is cheap to run, so it slows them very little.
- Do not reuse a password. If the passphrase leaks from another site's breach, the protection is gone.
Where to keep the passphrase
The passphrase only adds security if it is stored separately from the phrase. If both sit in the same safe, a thief gets both and you gained nothing but complexity.
A workable arrangement:
- Keep the recovery phrase in one place, such as a steel plate in a home safe.
- Keep the passphrase in a different place, such as a sealed note in a bank box or with a trusted person, or memorized and also written down once.
- Make sure the two locations are not likely to fail together (the same fire, the same burglar, the same person).
Memory alone is risky. Illness, injury, or stress can erase it. A purely memorized passphrase suits only people who also have a documented plan for what happens if they die.
Passphrase on a hardware wallet
Hardware wallets handle the passphrase in different ways. Some let you type it on the device. Some ask you to type it on the connected computer, which exposes it to that computer's malware. Check how your device works before relying on it. Prefer entering it on the device itself. If you must enter it on a computer, use a computer you trust.
Some devices also offer a feature where the passphrase is attached to a PIN, so a different PIN opens a different hidden wallet. That is a convenience built by the vendor and is not part of BIP-39. Backups of such setups restore only on compatible hardware, unless you also record the passphrase.
Testing a passphrase wallet safely
The verification chapter described how to test a backup without putting funds at risk. The same method applies here, with one more step:
- Restore the phrase and passphrase on a second device or a fresh wallet install.
- Compare the first receiving address with the one on your original wallet. They must match exactly.
- Restore once with the phrase only, and confirm that you get a different address. This shows you the standard wallet and proves the passphrase is doing something.
- Send a small amount to the passphrase wallet first, then restore again and confirm you can see it.
If the first address does not match, you have a typo in the passphrase or the phrase. Fix that before you move real funds.
When a passphrase is worth it
A passphrase adds protection and adds a failure point. Use this decision guide.
- Probably worth it: You hold a large amount, your physical storage might be found by others (shared home, travel, safe deposit box with bank access), you have a clear way to store the passphrase separately, and you have written instructions for your heirs.
- Probably not worth it: You hold a modest amount, you are new to self-custody, you have no tested backup yet, or you cannot describe where the passphrase will live.
- Consider other tools instead: If your goal is to survive the loss of one backup, or to avoid trusting a single location, multisig or Shamir splitting (next chapters) solve that problem more directly. A passphrase protects against someone finding the phrase. It does not protect against losing it.
Add a passphrase only after your plain phrase backup has been written, stored, and restored successfully at least once. Adding it earlier mixes two sources of error, and you will not know which one failed.
Summary of trade-offs
| Benefit | Cost |
|---|---|
| A stolen phrase alone cannot move your funds | A forgotten passphrase means permanent loss |
| Allows a decoy wallet under pressure | A typo shows an empty wallet and no error |
| Costs nothing to add | Needs its own storage, backup, and inheritance plan |
Exercise
You restore your wallet with your 24 words and an empty passphrase, and you see a balance of zero. You set up a passphrase last year. What most likely happened, and what should you check before assuming the funds are gone?
Show answer
You opened the standard wallet, which is separate from the passphrase wallet. The funds are probably still in the hidden wallet. Restore again with the exact passphrase, watching for case, spaces, punctuation, and keyboard layout. Compare the first address with one you saved before. Do not assume the funds are lost, and do not send anything from the empty wallet.
Exercise
A friend keeps their recovery phrase and their passphrase together in the same fireproof safe. What does the passphrase protect against in that arrangement, and what should they change?
Show answer
It protects against almost nothing, since anyone who opens the safe gets both secrets. They should store the passphrase in a different location that would not be lost or found at the same time, and confirm that they have recorded instructions so heirs can find both.