BIP39¶
BIP39 (Bitcoin Improvement Proposal 39) is a Bitcoin improvement proposal that introduces a standard method for generating wallet seeds from mnemonic words.
This standard improves the convenience and security of generating, backing up, and recovering cryptocurrency wallets. Below is a detailed introduction to BIP39:
Mnemonic Generation¶
BIP39 defines a method to convert randomly generated entropy into a set of mnemonic words. Typically, these mnemonic words are selected from a predefined dictionary of 2,048 words, commonly in quantities of 12, 15, 18, 21, or 24 words. This design makes mnemonic words easy to read, write, and more memorable compared to pure character passwords.
Mnemonic to Seed¶
Mnemonic words are not used directly to generate key pairs (private and public keys). Instead, they are first converted into a seed. This seed is generated by inputting the mnemonic words and an optional passphrase into the PBKDF2 (Password-Based Key Derivation Function 2) algorithm. The generated seed can then be used to derive a series of cryptographic key pairs.
Key Derivation¶
After the seed is generated, the BIP32 or BIP44 standard is typically used to derive specific key pairs from the seed.
BIP32 defines Hierarchical Deterministic Wallets (HD Wallets), allowing an infinite number of child keys to be derived from a single seed.
BIP44 further defines a multi-account structure on top of BIP32.
Security¶
The mnemonic generation process requires high-quality random entropy to ensure security. If the entropy quality is poor, the generated mnemonics and seeds will also be insecure. For backing up mnemonics, it is strongly recommended that users store mnemonic words offline, avoiding storage on internet-connected devices to prevent theft.
Wallet Recovery¶
When wallet recovery is needed, users simply re-enter their previously generated mnemonic words and optional passphrase to regenerate the original seed, thereby recovering all key pairs and accounts.
Compatibility¶
BIP39 is a widely adopted standard supported by many popular hardware wallets and software wallets. This means users can relatively easily migrate and recover accounts between different wallets.
Through BIP39, users can conveniently manage their crypto assets while ensuring security, and it greatly simplifies the wallet backup and recovery process.