Learning Objectives:

  • Master Bitcoin wallet types and their security

  • Understand HD wallets (BIP-32, BIP-39, BIP-44)

  • Analyze wallet security best practices


3.4.1: Wallet Types Overview

Wallet Classification:

 
 
Type Description Security Convenience Examples
Paper Wallet Printed private keys Very High Very Low Physical backup
Hardware Wallet Dedicated security device Very High Medium Ledger, Trezor
Desktop Wallet Software on computer High Medium Bitcoin Core, Electrum
Mobile Wallet Smartphone app Medium High BRD, BlueWallet
Web Wallet Browser-based wallet Low Very High Blockchain.com
Exchange Wallet Custodial by exchange Very Low Very High Coinbase, Binance

Hot vs Cold Wallets:

Hot Wallet (Connected): – Always connected to internet – Convenient for transactions – Higher risk (hacking, phishing) – Daily use, small amounts Cold Wallet (Offline): – No internet connection – Very secure – Inconvenient for transactions – Storage of large amounts

3.4.2: HD Wallets (BIP-32)

Hierarchical Deterministic Wallets:

HD wallets generate a tree of keys from a single seed, enabling deterministic key derivation and easy backup.

 
HD Wallet Structure:

Seed (12/24 words)
     │
     ▼
Master Private Key (m)
     │
     ├─── m/0' (Hardened)
     │      │
     │      ├─── m/0'/0 (Address 1)
     │      ├─── m/0'/1 (Address 2)
     │      └─── ...
     │
     ├─── m/1' (Hardened)
     │      │
     │      ├─── m/1'/0 (Address 1)
     │      └─── ...
     │
     └─── m/2' (Hardened)
            │
            └─── ...

Key Derivation (BIP-32):

Child Key Derivation:

Private Derivation (Normal):
1. data = pubkey_parent || child_index
2. I = HMAC-SHA512(chain_code_parent, data)
3. child_private = (parent_private + I_L) mod n
4. child_chain = I_R

Private Derivation (Hardened):
1. data = 0x00 || private_key_parent || child_index
2. I = HMAC-SHA512(chain_code_parent, data)
3. child_private = (parent_private + I_L) mod n
4. child_chain = I_R

Public Derivation:
1. data = pubkey_parent || child_index
2. I = HMAC-SHA512(chain_code_parent, data)
3. child_public = parent_public + I_L × G
4. child_chain = I_R

3.4.3: Mnemonic Phrases (BIP-39)

Mnemonic Generation:

Mnemonic Process:

1. Generate Entropy:
   - 12 words: 128 bits (16 bytes)
   - 18 words: 192 bits (24 bytes)
   - 24 words: 256 bits (32 bytes)

2. Add Checksum:
   - 12 words: 4 bits checksum
   - 24 words: 8 bits checksum
   - SHA-256 of entropy

3. Split into Words:
   - Each word = 11 bits
   - Map to BIP-39 word list

4. Generate Seed:
   - PBKDF2: 2048 iterations
   - HMAC-SHA512
   - Salt: "mnemonic" + passphrase
   - Output: 512-bit seed

Word List Properties:

text
BIP-39 Word List (2048 words):

Characteristics:
- 4-8 characters per word
- Unique first 4 letters
- No similar words (to avoid confusion)
- Language-specific lists

Examples (English):
abandon  ability  able  about  above  absent  absorb
abstract  abuse  access  accident  account  accuse  achieve
acid  acoustic  acquire  across  act  action  actor  actress

3.4.4: Address Derivation Paths (BIP-44)

Standard Derivation Path:

 
BIP-44 Path:
m / purpose' / coin_type' / account' / change / address_index

Where:
- purpose: Always 44' for BIP-44
- coin_type: 0' = Bitcoin, 1' = Testnet
- account: Sequential account numbers (0', 1', 2', ...)
- change: 0 = Receiving, 1 = Change
- address_index: Sequential address numbers

Examples:
Bitcoin: m/44'/0'/0'/0/0
Bitcoin Testnet: m/44'/1'/0'/0/0
Litecoin: m/44'/2'/0'/0/0
Ethereum: m/44'/60'/0'/0/0

BIP-49 (SegWit): m/49'/0'/0'/0/0
BIP-84 (Native SegWit): m/84'/0'/0'/0/0
BIP-86 (Taproot): m/86'/0'/0'/0/0

3.4.5: Wallet Security Best Practices

Security Checklist:

 
Seed Phrase Security:
☐ Store offline (no digital copies)
☐ Multiple physical copies
☐ Different secure locations
☐ Fire/water protection
☐ Never share with anyone

Passphrase Security:
☐ Use strong, memorable passphrase
☐ Separate from seed phrase
☐ Back up separately
☐ Consider multi-signature

Hardware Wallet Security:
☐ Purchase from trusted source
☐ Verify firmware authenticity
☐ Update firmware regularly
☐ Use PIN protection
☐ Enable passphrase

Transaction Security:
☐ Verify addresses thoroughly
☐ Check amounts carefully
☐ Use trusted network connections
☐ Keep software updated

Recovery Planning:
☐ Test recovery process
☐ Document recovery steps
☐ Share with trusted contacts
☐ Consider inheritance planning

Common Wallet Threats:

 
 
Threat Description Mitigation
Phishing Fake websites/apps Verify URLs, use bookmarks
Malware Keylogging, clipboard hijacking Use hardware wallets
Physical Theft Stolen device/hardware PIN, passphrase, multi-sig
Social Engineering Tricking into revealing keys Education, never share keys
Exchange Hacks Custodial fund loss Non-custodial wallets
Lost Seed No backup Multiple backups

 

1. BIP-32 Extended Keys

Extended Key Format:

Extended Private Key (xprv):
- Version: 0x0488ADE4 (mainnet)
- Depth: 1 byte
- Parent Fingerprint: 4 bytes
- Child Number: 4 bytes
- Chain Code: 32 bytes
- Key: 33 bytes (0x00 + private key)
- Total: 78 bytes
- Base58Check encoding

Extended Public Key (xpub):
- Version: 0x0488B21E (mainnet)
- Depth: 1 byte
- Parent Fingerprint: 4 bytes
- Child Number: 4 bytes
- Chain Code: 32 bytes
- Key: 33 bytes (compressed public key)
- Total: 78 bytes
- Base58Check encoding

2. BIP-39 Checksum Calculation

Checksum Example (12 words, 128 bits):

Entropy: 0x0102030405060708090a0b0c0d0e0f10

1. SHA-256(entropy) = 0x1234...abcd
2. Take first 4 bits: 0x1
3. Total bits: 128 + 4 = 132
4. Split into 11-bit words (12 words)
5. Map to word list

Word: abandon (0), ability (1), ...