Skip to main content
Bip39 implements the BIP-39 mnemonic code standard backed by @scure/bip39: entropy-to-word encoding (12 to 24 words with SHA-256 checksum), mnemonic validation, and 64-byte seed derivation via PBKDF2-HMAC-SHA512 (2048 iterations).

Mnemonic and Seed Pipeline

Quick Start

Entropy and Word Counts

API Reference

All functions are exported on Bip39 and as named exports from @tevm/voltaire/Bip39.

Constants

  • ENTROPY_128 = 128, ENTROPY_160 = 160, ENTROPY_192 = 192, ENTROPY_224 = 224, ENTROPY_256 = 256
  • SEED_LENGTH = 64

Security Notes

BIP-39 passphrases have no checksum: a typo in the passphrase silently derives a valid but completely different seed and set of addresses. Never rely on mnemonicToSeed to validate a passphrase.
  • Zero seed buffers: Call seed.fill(0) after initializing the master HD key with HDWallet.
  • Errors: Invalid entropy lengths throw InvalidEntropyError; invalid mnemonics in assertValidMnemonic throw InvalidMnemonicError; other failures throw Bip39Error.