We manage your security to weather the AI storm →

← Resource Hub

What Is BIP39? How 12- and 24-Word Seed Phrases Work

By Daniel GelfandPublished 5 min read

Part of our guide to multisig best practices

What Is BIP39? How 12- and 24-Word Seed Phrases Work

Quick answer. BIP39 is a wallet standard that encodes 128 or 256 random bits plus a checksum as 12 or 24 words from a fixed list, respectively. The phrase and an optional passphrase determine the binary seed a wallet uses to derive keys.

Watch: What Is BIP39? How 12- and 24-Word Seed Phrases Work 1:33
Video transcript

A recovery phrase can pass its checksum even if it came from predictable input. BIP thirty-nine is a wallet standard, not a Bitcoin consensus rule: it defines how to encode random bits as recovery words and derive a binary seed from those words.

The wallet starts with random bits and appends a short checksum calculated from them. It splits the result into groups of eleven bits. Each group picks a word from a fixed list.

Twelve words encode one hundred twenty-eight input bits plus four checksum bits. Twenty-four words encode two hundred fifty-six plus eight. The checksum adds no independent randomness.

The recovery words and any optional passphrase determine the binary seed the wallet uses to derive keys. A passphrase typo can produce a different seed without a checksum warning, so the wallet may look empty.

Milk Sad researchers found at most thirty-two bits of entropy in an affected Libbitcoin Explorer generator. It could supply enough bytes for twenty-four words without making the input any less predictable.

Use test vectors to check the phrase and seed. Trace the random source in each production build and verify wallet creation stops if it fails. In a recovery drill, check that the restored wallet reproduces one recorded receiving address for the intended account and path.

Read the full guide for the recovery checklist, or ask Guardian for an OpSec audit to review your team's signing and recovery procedures.

What BIP39 Specifies

Bitcoin Improvement Proposal 39 is an application-layer specification, not a Bitcoin consensus rule; it defines what is BIP39-compliant in mnemonic encoding and seed derivation.[1]

A BIP39 mnemonic is the ordered list of recovery words. The binary seed is a separate value derived from that phrase.

Neither is an individual private key. BIP32 takes the binary seed and produces a master private key and chain code, then derives child keys from that root.[2]

BIP44 is a separate convention for organizing and finding accounts. The mnemonic itself does not tell a recovery app which account or address format to use.[3]

For custody teams, an OpSec audit reviews where keys are stored and how recovery works after a lost device or a staff departure.

The BIP39 Word List

The Bitcoin BIPs repository publishes the official English BIP39 word list as a plain text file. It contains 2,048 entries in fixed order.[1, 4]

Your selected words and their order are recovery material. Look up the public list itself, but never paste your phrase into a website to check it.

The wallet hashes the input with SHA-256. It appends the first N hash bits, where N is the input length in bits divided by 32.

The wallet splits the combined bits into 11-bit groups. Each group selects one word by its position in the list, starting at index zero.

The words represent bits, not a sentence someone chose. Don’t compose a phrase from memorable words or substitute a favorite word during backup.

An importer can reverse the lookup and recompute the checksum. BIP39 requires a warning when the checksum is invalid.

12 vs 24 Words

Checksum bits are derived from the entropy. They add no independent randomness.[1]

The last word is not just a checksum. Its index includes seven input bits in a 12-word phrase and three in a 24-word phrase.

Exactly 1 in 16 ordered 12-word sequences from the list passes the checksum, compared with 1 in 256 for 24 words. These are validity rates, not typo rates.

Choose a length your approved recovery device supports.

WordsInput bitsChecksum bitsEncoded bits
121284132
151605165
181926198
212247231
242568264

The Optional Passphrase

BIP39 runs PBKDF2 with HMAC-SHA512 for 2,048 iterations, using the mnemonic as the password. It produces a 64-byte seed at every phrase length.[1]

The salt is the literal string mnemonic followed by the passphrase. Without a passphrase, only the prefix remains.

Both inputs use Unicode NFKD normalization and UTF-8 encoding. A passphrase is not an extra word from the list or a PIN for the device.[5]

A typo that changes the normalized passphrase derives a different seed. The mnemonic checksum cannot flag that typo, so the app can show an empty wallet.

There is no reset that gets you back to the original wallet. To switch passphrases, move funds to the wallet derived with the new one.

Decide who can retrieve the passphrase before enabling it. Keep it separate from the mnemonic, and make sure the recovery procedure tells authorized staff how to reach both.

Entropy Failures in Wallets

Entropy measures unpredictability, not how random bytes look. Expanding a small set of possible starting values into more bytes does not add unpredictability.[6]

Milk Sad showed the difference. In Libbitcoin Explorer 3.0.0 through 3.6.0, the bx seed command used a clock-seeded generator that was not designed for cryptography.[7, 8]

The generator had at most 32 bits of entropy, even when asked to output enough bytes for 24 words. A wallet could encode those bytes correctly.[1]

The weakness documented in CVE-2023-39910 was upstream of BIP39. Predictable input put derived keys at risk, and any protection from a passphrase depended in part on its strength.

In its August 8, 2023 disclosure, the Milk Sad team attributed about 29.65 BTC to three transactions from the July 12, 2023 theft.

In January 2024, researchers found another transaction and inputs consistent with an older Trust Wallet iOS flaw. Their estimate of more than US$1 million in BTC at the time covered the broader July 12 theft, not Libbitcoin alone.[9]

Libbitcoin Explorer v3.8.0 removed bx seed. Updating the tool or reimporting the old words does not replace keys already generated from weak input.[10]

In a separate case, Trust Wallet browser extension builds 0.0.172 through 0.0.182 also limited newly generated phrases to 32 bits of entropy.[11, 12]

Trust Wallet’s November 2022 patch switched its WebAssembly build to platform cryptographic randomness. CVE-2023-31290 records exploitation in December 2022 and March 2023.[13]

If your phrase came from an affected generator, create a new wallet with a trusted source of randomness. Move funds to the new wallet.

Test Generation and Recovery

The linked BIP39 vectors use the fixed test passphrase TREZOR. Use the fixture inputs and compare both your mnemonic and derived seed with the expected outputs.[1, 14]

A passing test vector tells you what the code does with supplied bytes. It does not tell you where a production build gets those bytes.

Trace that production path for each supported platform, including bundled libraries and firmware. Record the cryptographic random source and the build that uses it.

In a test build, make the approved random source fail. Wallet creation should stop and show an error, not switch to a clock or a weaker generator.

Run a controlled restore on an approved spare device. If the app accepts the phrase but shows unexpected addresses, check the derivation path and address type.[2, 3, 5]

Compare the restored receiving address with a previously recorded one for the intended account and path. A match confirms that one address was reproduced.

For witness roles and ceremony records, see our guide to key ceremonies in crypto custody.

  • Record the wallet software, network, account index, derivation path, address type and whether recovery requires a passphrase.
  • Test each account the team needs to recover.
  • Log the result, device and approver without logging the mnemonic, binary seed or passphrase.

Review How Your Team Handles Recovery

Ask Guardian for an OpSec audit to map which signers can move funds and what controls protect each path.

Frequently Asked Questions

Is every 12-word seed phrase BIP39?

No. Electrum generates phrases with its own versioned format. Identify the source wallet’s actual backup format before importing a phrase elsewhere.[15]

Can you translate a BIP39 mnemonic?

Not if you want to keep the same wallet. Translating words changes the input to seed derivation, even if each translated word occupies the same position in another list. Keep the original words.[1]

Can you turn any binary seed into a BIP39 phrase?

No general conversion exists. BIP39 derives the seed from the words in one direction only. If you encode raw seed bytes of a supported length as mnemonic entropy, a BIP39 restore won’t return the original seed.[1, 2]

What is the BIP44 address gap limit?

BIP44 stops scanning a receiving chain after 20 unused addresses in a row. A used address beyond that gap can be missed during discovery, even when the phrase restores the right keys.[3]

Sources

  1. Bitcoin.org: BIP 39: Mnemonic code for generating deterministic keys
  2. Bitcoin.org: BIP 32: Hierarchical Deterministic Wallets
  3. Bitcoin.org: BIP 44: Multi-Account Hierarchy for Deterministic Wallets
  4. Bitcoin BIPs repository: BIP39 English wordlist
  5. Trezor: Fix passphrase wallet problems in Trezor Suite
  6. Internet Engineering Task Force: RFC 4086: Randomness Requirements for Security
  7. Milk Sad research team: Milk Sad: Libbitcoin Explorer technical disclosure
  8. MITRE for the CVE Program: CVE-2023-39910: Libbitcoin Explorer weak entropy
  9. Milk Sad research team: Milk Sad Update #5: Digging Into New Trust Wallet Research
  10. Libbitcoin: Libbitcoin Explorer v3.8.0 release notes
  11. MITRE for the CVE Program: CVE-2023-31290: Trust Wallet browser extension weak entropy
  12. Ledger: Ledger Donjon disclosure on Trust Wallet browser extension seed generation
  13. Trust Wallet: Trust Wallet Core: use JavaScript for random generation
  14. Trezor: BIP39 reference implementation test vectors
  15. Electrum: Electrum Seed Version System
  16. Trezor: Troubleshoot wallet backup and recovery problems
  17. Bitcoin Optech: Bitcoin Optech Newsletter #263
  18. Unchained: TrustWallet Discloses $170,000 Exploit, Says 500 Wallets Still Vulnerable