What are BIP 32, BIP 38, BIP 39?

Understanding Bitcoin Improvement Proposals (BIPs)

Bitcoin Improvement Proposals (BIPs) are essential documents that provide valuable information to the Bitcoin community, detailing new features, processes, or environments for Bitcoin. Three significant BIPs in the realm of Bitcoin key management and security are BIP 32 BIP 38 and BIP 39. Let’s delve into what each of these BIPs entails and their contributions to Bitcoin.

Tree as a hierarchical concept of deterministic wallets

BIP 32: Hierarchical Deterministic (HD) Wallets

BIP 32 introduces the concept of hierarchical deterministic (HD) wallets, which revolutionizes the way Bitcoin addresses and keys are managed. Here’s how BIP 32 enhances Bitcoin key management:

  1. Master Seed: HD wallets generate all their keys from a single master seed. This seed, often a string of simple words, makes it easy to back up and restore the entire wallet.
  2. Deterministic Key Generation: From this master seed, HD wallets can deterministically generate a tree of private and public key pairs, ensuring that the same seed always produces the same keys.
  3. Hierarchical Structure: Keys are organized hierarchically, allowing users to create sub-accounts or multiple addresses without needing to back up each key individually.
  4. Improved Privacy: By using different addresses for each transaction, privacy is enhanced. HD wallets simplify managing and generating these addresses.
  5. Extended Keys: BIP 32 defines extended public and private keys, enabling secure sharing of public keys and derivation of child public keys without exposing private keys.

HD wallets are particularly beneficial for organizations or individuals managing multiple Bitcoin addresses, providing a convenient and secure method for key generation and backup.

BIP 38: Encrypted Private Keys

BIP 38 focuses on enhancing the security of individual private keys, particularly for paper wallets or physical backups. Here are the key features of BIP 38:

  1. Encryption: BIP 38 allows a private key to be encrypted with a passphrase, making the stored key unreadable without the passphrase.
  2. Passphrase Protection: Only someone who knows the passphrase can decrypt and use the private key, adding an extra layer of security.
  3. Standard Format: BIP 38 defines a specific format for these encrypted private keys, ensuring compatibility across various wallets and software.

BIP 38 is instrumental in safeguarding private keys from theft or loss by making it difficult for unauthorized individuals to access Bitcoin funds without the correct passphrase.

Tree as a seed phrase graph

BIP 39: Mnemonic Code for Generating Deterministic Keys

BIP 39, known as “Mnemonic Code for Generating Deterministic Keys,” standardizes the creation of human-readable and memorable seed phrases that generate the master seed for HD wallets. Key features of BIP 39 include:

  1. Mnemonic Phrase: A sequence of 12, 15, 18, 21, or 24 words representing the seed.
  2. Word List: A specific set of 2048 words used to form the mnemonic phrases, chosen for distinctiveness and memorability.
  3. Entropy and Checksum: The mnemonic phrase is generated from a random sequence of bits (entropy) with a checksum added to verify its integrity.
  4. Seed Generation: The mnemonic phrase is converted into a binary seed through key stretching using the PBKDF2 function with HMAC-SHA512.
  5. Passphrase Option: An optional passphrase can be added to the mnemonic phrase for an additional layer of security.

Process Overview

  1. Entropy Generation: Generate a random sequence of bits.
  2. Add Checksum: Append the checksum to the entropy.
  3. Create Mnemonic: Divide the result into 11-bit segments, mapping each segment to a word from the BIP 39 word list.
  4. Mnemonic Phrase: The result is a list of words (e.g., 12, 15, 18, 21, or 24 words).
  5. Seed Generation: Convert the mnemonic phrase (with an optional passphrase) into a binary seed.
  6. HD Wallet: Use the seed to generate the master key and chain code for the HD wallet.

Benefits of BIP 39

  • Human-Readable: Easier to write down, remember, and type compared to a binary or hexadecimal string.
  • Interoperability: Widely adopted and supported by many wallets and services, ensuring users can recover their funds using different wallet implementations.
  • Security: The optional passphrase adds an extra layer of security, making it harder for attackers to use the mnemonic phrase without the passphrase.

In summary, BIPs 32, 38, and 39 collectively enhance Bitcoin’s key management and security, making it easier and safer to handle multiple addresses and private keys. These BIPs provide robust frameworks for creating, securing, and managing Bitcoin wallets, ensuring both convenience and security for users.

purple tree and its branches are bip 32, bip 38 and bip 39

Crypto Wallets using BIP 32, BIP 39

Hardware Wallets

  1. Ledger: Supports BIP 32 and BIP 39, allowing for secure storage and easy recovery of keys using a 24-word seed phrase.
  2. Trezor: Implements BIP 32 and BIP 39 for generating and managing hierarchical deterministic wallets.
  3. KeepKey: Utilizes BIP 32 and BIP 39 for enhanced key management and security.

Software Wallets (Desktop/Mobile)

  1. Electrum: Uses BIP 32 for hierarchical deterministic wallets, ensuring easy backup and recovery.
  2. Exodus: Supports BIP 39 for mnemonic seed phrases, providing a user-friendly interface for managing multiple cryptocurrencies.

Mobile Wallets

  1. Mycelium Wallet: Utilizes BIP 32 and BIP 39 for secure key management and backup.

Web Wallets

  1. Blockchain Wallet: Supports BIP 39 for generating mnemonic seed phrases, ensuring that users can easily back up and recover their wallets.
  2. MyEtherWallet (MEW): Uses BIP 39 to create and manage wallet seed phrases for Ethereum and ERC-20 tokens.