Skip to main content

Try it Live

Run BIP39 examples in the interactive playground

Overview

BIP-39 mnemonic generation converts cryptographic entropy into human-readable word sequences. The process ensures deterministic, verifiable, and secure seed phrase creation.

Generation Process

1. Entropy Generation

Generate cryptographically secure random bytes:

2. Entropy to Mnemonic Conversion

3. Word Count Mapping

Algorithm Details

Step-by-Step Process

1. Generate Entropy (ENT)
2. Calculate Checksum (CS)
3. Concatenate
4. Split into 11-bit Groups
5. Map to Wordlist

Example Calculation

Entropy Sources

Browser Environment

Node.js Environment

Hardware Wallets

Hardware wallets use dedicated secure elements:

Utility Functions

Calculate Word Count

Calculate Entropy Bits

Security Considerations

Entropy Quality

Critical: Use cryptographically secure randomness

Entropy Size Recommendations

Minimum: 128 bits (12 words)
  • Provides 2^128 possible combinations
  • Considered secure against brute force
  • Suitable for low-to-medium value wallets
Recommended: 256 bits (24 words)
  • Provides 2^256 possible combinations
  • Future-proof against quantum computers
  • Recommended for high-value wallets

Deterministic Generation

Same entropy always produces same mnemonic:

Offline Generation

Best practice: Generate mnemonics offline

Advanced Usage

Custom Entropy Length

Dice-Roll Entropy (Maximum Security)

For maximum paranoia, generate entropy manually:

Verifying Generation

Common Errors

Invalid Entropy Length

Non-Random Entropy

Implementation Details

Uses @scure/bip39 by Paul Miller:
  • Audited implementation
  • Constant-time checksum validation
  • Support for multiple wordlists
  • NFKD normalization
  • Strict BIP-39 compliance

Examples

References