BIP39 passphrase generator

Generate a BIP39 passphrase from an existing or random mnemonic, or get the mnemonic from the passphrase.

BIP-39 Mnemonic Seed Phrase Generator: Cryptographic Entropy, PBKDF2 Derivation, and Hierarchical Deterministic Wallets

1. Quick Overview & Core Advantages

Bitcoin Improvement Proposal 39 (BIP-0039) is the universal industry standard for generating deterministic cryptographic keys from a human-readable sequence of mnemonic words. Formulated by Marek Palatinus, Pavol Rusnak, Aaron Voisine, and Sean Bowe in 2013, BIP-39 bridged the gap between complex raw binary private keys and human usability, establishing the security foundation for virtually all modern non-custodial cryptocurrency wallets (Bitcoin, Ethereum, Solana, Cosmos, Polkadot) and Hierarchical Deterministic (HD) keychains (BIP-32 / BIP-44).

Rather than forcing users to transcribe 256 bits of hexadecimal noise or raw elliptic curve private keys, BIP-39 deterministically maps initial high-entropy randomness into 12, 15, 18, 21, or 24 standardized words chosen from an exact dictionary of 2,048 carefully vetted words.

Core Architectural Advantages

  • Cryptographically Secure In-Browser PRNG: Random entropy is gathered strictly via the browser’s hardware-backed window.crypto.getRandomValues() Cryptographically Secure Pseudo-Random Number Generator (CSPRNG), pulling from system entropy pools (OS kernel random devices like /dev/urandom or Windows CryptGenRandom/BCryptGenRandom).
  • 100% Client-Side Air-Gapped Operation: Mnemonic words, raw entropy bytes, salt phrases, and PBKDF2 output seeds are computed entirely in your local browser’s WebAssembly / JavaScript runtime memory. No seed data is ever sent to any remote server, cached in cloud logs, or transmitted across network interfaces. You can safely disconnect your internet or run this page in an offline browser sandbox.
  • Strict Adherence to Standard Wordlists: Supports standard RFC-compliant multilingual wordlists (English, Japanese, Spanish, French, Italian, Korean, Simplified/Traditional Chinese, Czech, Portuguese), where each word is unambiguously identifiable by its first four characters.

2. Step-by-Step Custom Configuration Guide

Generating and converting a BIP-39 mnemonic phrase into root master keys requires understanding entropy length parameters, optional passphrases (“13th / 25th word”), and derivation pathways.

Step 1: Selecting Entropy Length & Word Counts

BIP-39 defines a deterministic relationship between initial raw entropy bits ($ENT$), checksum bits ($CS$), and total word count ($MS$):

Entropy Bits ($ENT$) Checksum Bits ($CS$) Total Bits ($ENT + CS$) Mnemonic Words ($MS$) Security Strength
128 bits (16 bytes) 4 bits 132 bits 12 words Standard (128-bit symmetric security)
160 bits (20 bytes) 5 bits 165 bits 15 words Medium
192 bits (24 bytes) 6 bits 198 bits 18 words High
224 bits (28 bytes) 7 bits 231 bits 21 words Very High
256 bits (32 bytes) 8 bits 264 bits 24 words Maximum (256-bit institutional security)

Step 2: Implementation Walkthrough in Modern TypeScript / Web Crypto

Below is the pure algorithmic pipeline implemented natively in modern JavaScript/TypeScript using the Web Crypto API:

/**
 * Browser-Native BIP-39 Mnemonic Generator
 */
export async function generateBip39Mnemonic(
  entropyBits: 128 | 160 | 192 | 224 | 256,
  wordlist: string[]
): Promise<{ mnemonic: string; entropyHex: string; checksumBits: string }> {
  if (wordlist.length !== 2048) {
    throw new Error("BIP-39 wordlist must contain exactly 2048 words.");
  }

  // 1. Generate cryptographically secure random entropy
  const entropyBytes = new Uint8Array(entropyBits / 8);
  window.crypto.getRandomValues(entropyBytes);
  const entropyHex = Array.from(entropyBytes)
    .map(b => b.toString(16).padStart(2, '0'))
    .join('');

  // 2. Compute SHA-256 hash of the entropy to extract checksum
  const hashBuffer = await window.crypto.subtle.digest('SHA-256', entropyBytes);
  const hashBytes = new Uint8Array(hashBuffer);

  // 3. Extract first ENT / 32 bits from the hash
  const checksumLength = entropyBits / 32;
  const hashByteFirst = hashBytes[0];
  const checksumBits = hashByteFirst
    .toString(2)
    .padStart(8, '0')
    .slice(0, checksumLength);

  // 4. Convert entropy bytes to full binary string
  let fullBits = '';
  for (const byte of entropyBytes) {
    fullBits += byte.toString(2).padStart(8, '0');
  }
  fullBits += checksumBits;

  // 5. Split 11-bit chunks and map to wordlist
  const words: string[] = [];
  for (let i = 0; i < fullBits.length; i += 11) {
    const chunk = fullBits.slice(i, i + 11);
    const index = parseInt(chunk, 2);
    words.push(wordlist[index]);
  }

  return {
    mnemonic: words.join(' '),
    entropyHex,
    checksumBits
  };
}

3. Algorithmic Principles, Entropy Math & BIP-32/44 Derivation Specs

The Entropy to Mnemonic Pipeline

The generation of a valid mnemonic phrase proceeds according to the following mathematical specifications:

  1. Entropy Generation: A random number generator yields an initial sequence of $ENT$ bits, where $ENT \in {128, 160, 192, 224, 256}$.
  2. Checksum Calculation: The SHA-256 cryptographic hash of the entropy bytes is computed: $\text{Hash} = \text{SHA256}(ENT)$ The first $CS = \frac{ENT}{32}$ bits of the hash are appended to the end of the initial entropy: $\text{Payload} = ENT \mathbin{\Vert} \text{CS}$
  3. Word Index Mapping: The concatenated payload has a total length of $ENT + CS$, which is guaranteed to be a multiple of 11. The payload is split into groups of 11 bits: $\text{Number of Words } MS = \frac{ENT + CS}{11}$ Each 11-bit integer $k \in [0, 2^{11}-1] = [0, 2047]$ acts as a direct array index into the 2,048-word dictionary.
+---------------+---------------+
|  Entropy Bits | Checksum Bits |
|   (128-256)   |    (4-8)      |
+---------------+---------------+
        |               |
        +-------+-------+
                |
                v
      [Total 132 to 264 Bits]
                |
     Split into 11-Bit Chunks
                |
    +---+---+---+---+---+---+
    | 1 | 2 | 3 |...| n | n |  -> Maps to Wordlist Indexes [0..2047]
    +---+---+---+---+---+---+

The Seed Derivation: PBKDF2-HMAC-SHA512

A mnemonic alone cannot sign blockchain transactions. To convert the mnemonic into a 512-bit binary master seed, BIP-39 specifies the Password-Based Key Derivation Function 2 (PBKDF2):

  • PRF: HMAC-SHA512
  • Password: The normalized UTF-8 (NFKD) mnemonic phrase.
  • Salt: The string "mnemonic" concatenated with an optional user passphrase: $\text{Salt} = \text{NFKD}(“mnemonic” + \text{passphrase})$
  • Iteration Count: Exactly $2,048$ iterations.
  • Output Key Length: 512 bits (64 bytes).

$\text{Seed} = \text{PBKDF2}(\text{HMAC-SHA512}, \text{Mnemonic}, \text{Salt}, 2048, 64)$

The resulting 512-bit seed is partitioned into two 256-bit halves: the Master Private Key and the Master Chain Code, which initialize the hierarchical deterministic tree according to BIP-32:

                        512-bit Binary Seed
                                 |
                 +---------------+---------------+
                 |                               |
        Master Private Key               Master Chain Code
            (256 bits)                       (256 bits)

4. Production Architectures & Crypto Custody Integration

Production Architecture: BIP-44 Multi-Account HD Wallet

Modern wallets (MetaMask, Ledger, Trezor, Trust Wallet) derive accounts across multiple blockchains from a single BIP-39 root seed using standard BIP-44 derivation paths:

m / purpose' / coin_type' / account' / change / address_index
  • Bitcoin Mainnet (P2WPKH Native SegWit - BIP-84): m/84'/0'/0'/0/0
  • Ethereum / EVM Chains (EIP-600): m/44'/60'/0'/0/0
  • Solana (SLIP-0044): m/44'/501'/0'/0'
                    Root BIP-39 Seed
                           |
                     Master Key (m)
                           |
                     Purpose (44')
                           |
             +-------------+-------------+
             |                           |
       Bitcoin (0')                Ethereum (60')
             |                           |
        Account (0')                Account (0')
             |                           |
        External (0)                External (0)
             |                           |
       Address 0, 1, 2...          Address 0, 1, 2...

Cold Storage & Key Ceremony Security Protocols

  1. Air-Gapped Hardware Wallets: During initial device setup, the secure element (SE) generates BIP-39 entropy internally. This browser utility serves as a transparent educational validator to verify phrase math and test recovery mechanics.
  2. Metal Backup Plates: In institutional disaster recovery planning, mnemonic words are etched onto titanium or stainless steel plates to survive fires, water damage, and physical degradation.
  3. Multi-Party Computation (MPC) / Shamir Secret Sharing (SLIP-0039): Enterprise custodians split master entropy across $k$-of-$n$ threshold shares so no single employee possesses the complete seed phrase.

5. Frequently Asked Questions (FAQs)

What is the “25th Word” or BIP-39 Passphrase, and how does it protect my funds?

The BIP-39 passphrase (sometimes referred to as the 13th or 25th word) is an optional secret string appended to the PBKDF2 salt ("mnemonic" + passphrase). It provides two vital security defenses:

  1. Plausible Deniability: Entering different passphrases deterministically produces completely different wallet addresses from the same 24 words. An individual can keep a small “decoy balance” under an empty passphrase and protect their primary portfolio under a secret passphrase.
  2. Physical Theft Immunity: If an attacker steals your written metal seed sheet, they still cannot access your funds without the separate passphrase stored securely elsewhere.

Can two independent people accidentally generate the exact same 24-word seed phrase?

Mathematically, the probability is so infinitesimally small that it is considered virtually impossible. A 24-word phrase has 256 bits of entropy, giving $2^{256} \approx 1.1579 \times 10^{77}$ possible combinations. This number is comparable to the estimated total number of atoms in the observable universe ($\approx 10^{80}$). Even if every supercomputer on Earth generated billions of seed phrases per second for trillions of years, the chance of a collision remains effectively zero.

Why do all words in the BIP-39 English dictionary have unique first 4 letters?

The BIP-39 English wordlist was intentionally engineered so that no two words share the same first four characters. For three-letter words like act or cat, the word itself is complete. For all words with four or more letters, the first 4 characters uniquely identify the word across the entire 2,048-word dictionary. This allows hardware wallets and recovery software to auto-complete keystrokes safely and prevents transcription errors.

Why does my wallet show an “Invalid Checksum” error when importing my seed phrase?

The last word of any BIP-39 mnemonic contains the checksum bits ($CS$) derived from the SHA-256 hash of all preceding entropy bits. You cannot simply assemble 12 or 24 arbitrary words from the dictionary at random; if the final word’s embedded checksum bits do not match the hash of the preceding bits, modern wallet software immediately flags the phrase as corrupt. This built-in mathematical check protects users from losing funds due to misspelled or swapped words.


6. Client-Side Privacy & Security Guarantee

This BIP-39 generator operates under a strict zero-knowledge, zero-network architecture:

  • All cryptographic key derivation, entropy generation via CSPRNG, SHA-256 hashing, and dictionary indexing execute 100% inside your local client machine’s browser memory.
  • No telemetry, analytics, cookies, local storage, or API calls touch your generated seeds or passphrases.
  • For maximum security when managing real assets, we advise generating production wallet seed phrases on dedicated, offline air-gapped hardware devices.