Learning Objectives:
-
Master wallet types and their security properties
-
Understand Hierarchical Deterministic (HD) wallets
-
Analyze key storage and recovery mechanisms
2.4.1: Wallet Types
Definition:
A cryptocurrency wallet is a software, hardware, or paper system that stores private keys and manages digital assets.
Wallet Categories:
Wallet Types: 1. Custodial vs Non-Custodial - Custodial: Keys held by third party - Non-Custodial: User controls keys 2. Hot vs Cold Wallets - Hot: Connected to internet - Cold: Offline storage 3. Software Wallets - Mobile: Phone apps - Desktop: Computer applications - Web: Browser-based 4. Hardware Wallets - Physical devices - Secure element - Offline signing 5. Paper Wallets - Printed keys - Offline storage - Physical security
2.4.2: Hierarchical Deterministic (HD) Wallets
Definition:
HD wallets generate a tree of keys from a single seed (mnemonic phrase), enabling deterministic key derivation and backup.
HD Wallet Structure:
HD Wallet Hierarchy:
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)
│
└─── ...
BIP-44 Path: m/44'/coin'/account'/change/address_index
Examples:
- Bitcoin: m/44'/0'/0'/0/0
- Ethereum: m/44'/60'/0'/0/0
- Solana: m/44'/501'/0'/0/0
Key Derivation:
Master Key Generation: 1. Seed → HMAC-SHA512 → Master Private Key 2. Master Private Key → Extended Key (xprv) Child Key Derivation (BIP-32): 1. Parent Key + Chain Code + Index 2. HMAC-SHA512 → Child Key + Chain Code 3. Child Private Key: (parent + hash) mod n 4. Chain Code: Used for further derivation Hardened vs Normal: - Hardened: Uses parent private key - Normal: Uses parent public key - Hardened: More secure (no parent key exposure) - Normal: Public derivation possible
2.4.3: Mnemonic Phrases (BIP-39)
Definition:
Mnemonic phrases are human-readable representations of a wallet seed, typically 12 or 24 words.
Word List:
BIP-39 Word List (2048 words): - Carefully chosen list - 3-8 characters per word - Unique prefixes (4 letters) - Language-specific lists Examples (English): abandon, ability, able, about, above, absent, absorb, abstract, abuse...
Seed Generation:
Mnemonic Generation: 1. Generate entropy: - 12 words: 128 bits entropy - 24 words: 256 bits entropy 2. Add checksum: - 12 words: 4 bits checksum - 24 words: 8 bits checksum 3. Map to words: - 11 bits per word - Lookup in word list 4. Seed Generation (PBKDF2): - Key: mnemonic phrase - Salt: "mnemonic" + passphrase - Iterations: 2048 - HMAC-SHA512 - Output: 512-bit seed 5. Add passphrase (optional): - Additional security layer - Different passphrase = Different wallet - "25th word"
2.4.4: Wallet Security
Security Concepts:
Security Model: - Private Key: Access to funds - Seed Phrase: Backup and recovery - Passphrase: Additional security Threats: 1. Private key theft (malware, phishing) 2. Seed phrase compromise (physical, digital) 3. Side-channel attacks 4. Social engineering 5. Physical theft Protection Layers: 1. Encryption (password protected) 2. Hardware security (secure element) 3. Multi-factor authentication 4. Multi-signature (M-of-N) 5. Time locks (delayed transactions)
2.4.5: Hardware Wallets
Definition:
Hardware wallets store private keys in a secure element, isolated from internet-connected devices.
Architecture:
Hardware Wallet Architecture: ┌─────────────────────────────────────────────────────────────────────┐ │ Hardware Wallet │ │ │ │ Secure Element (SE): │ │ ┌─────────────────────────────────────────────────────────────┐ │ │ │ • Private key storage │ │ │ │ • Cryptographic operations │ │ │ │ • Tamper-resistant │ │ │ │ • Physical unclonability │ │ │ └─────────────────────────────────────────────────────────────┘ │ │ │ │ Microcontroller: │ │ ┌─────────────────────────────────────────────────────────────┐ │ │ │ • Communication interface │ │ │ │ • Display control │ │ │ │ • Button input │ │ │ │ • Firmware management │ │ │ └─────────────────────────────────────────────────────────────┘ │ │ │ │ Display: │ │ ┌─────────────────────────────────────────────────────────────┐ │ │ │ • Transaction verification │ │ │ │ • Address confirmation │ │ │ │ • PIN entry │ │ │ └─────────────────────────────────────────────────────────────┘ │ └─────────────────────────────────────────────────────────────────────┘
Benefits:
| Benefit | Description |
|---|---|
| Private Key Isolation | Keys never leave device |
| Offline Signing | Sign transactions offline |
| Transaction Verification | Display shows transaction details |
| PIN Protection | Device requires PIN |
| Recovery Phrase | Seed backup |
| Firmware Updates | Security improvements |
2.4.6: Key Recovery and Inheritance
Recovery Methods:
1. Seed Phrase Recovery: - Most common method - Enter seed phrase in new wallet - Recover all keys and funds 2. Multi-Sig Recovery: - Use threshold of keys - M-of-N scheme - Protection against key loss 3. Social Recovery: - Trusted individuals - Shamir Secret Sharing - Distributed recovery 4. Inheritance Planning: - Dead Man's Switch - Timed locks - Transfer on death - Legal documentation
2.4.7: Wallet Types Comparison
| Feature | Hot Wallet | Cold Wallet | Hardware | Paper | Multi-Sig |
|---|---|---|---|---|---|
| Convenience | High | Low | Medium | Low | Medium |
| Security | Low | High | High | Very High | Very High |
| Cost | Free | Free | $50-200 | Free | Free |
| Recovery | Easy | Hard | Easy | Hard | Medium |
| Transaction Speed | Fast | Slow | Medium | Very Slow | Medium |
| Use Case | Daily Use | Storage | Storage | Backup | Shared Control |
ADDITIONAL DEEP TECHNICAL NOTES:
1. BIP-32 Key Derivation Detailed
Extended Key Format:
Extended Key (xprv/xpub): - Version bytes: 4 bytes - Depth: 1 byte - Parent Fingerprint: 4 bytes - Child Number: 4 bytes - Chain Code: 32 bytes - Key: 33 bytes (compressed public/private) Total: 78 bytes Base58Check encoding (111 characters) Example: xprv9s21ZrQH143K31xYSDQpPDxsXRTUcvj2iNHm5NUtrGiGG5e5Tx...
Derivation Algorithms:
Private Derivation: CKDpriv((k_par, c_par), i): 1. If i ≥ 2³¹ (hardened): - data = 0x00 || k_par || i - Hardened derivation 2. Else (normal): - data = pubkey_par || i - Normal derivation 3. I = HMAC-SHA512(c_par, data) 4. k_i = (k_par + I_L) mod n 5. c_i = I_R Public Derivation: CKDpub((K_par, c_par), i): 1. Must be normal (i < 2³¹) 2. data = K_par || i 3. I = HMAC-SHA512(c_par, data) 4. K_i = K_par + I_L × G 5. c_i = I_R
2. BIP-39 Word List Properties
Checksum Calculation:
Checksum Calculation (12 words): 1. Entropy: 128 bits (16 bytes) 2. SHA-256: 256 bits 3. Take first 4 bits as checksum 4. Total: 132 bits 5. Split into 11-bit words (12 words) Example: Entropy: 0x0102030405060708090a0b0c0d0e0f10 Checksum: 0x1 Bits: 128 + 4 = 132 bits Words: 12 × 11 bits = 132 bits
3. Wallet Security Best Practices
Security Checklist:
1. Seed Phrase: ☐ Store offline (no digital copies) ☐ Multiple physical copies ☐ Different locations ☐ Protection from fire/water 2. Passphrase: ☐ Strong, memorable ☐ Separate from seed ☐ Backup separately 3. Multi-Sig: ☐ Consider for large holdings ☐ Geographic distribution ☐ Different custodians 4. Hardware: ☐ Purchase from trusted source ☐ Verify firmware ☐ Update regularly 5. Encrypted Backup: ☐ Encrypt digital backups ☐ Use strong encryption ☐ Store encryption key separately
4. Key Recovery Scenarios
| Scenario | Solution | Complexity |
|---|---|---|
| Lost Device | Restore from seed | Low |
| Stolen Device | Restore from seed + Move funds | Medium |
| Lost Seed | Multi-sig recovery | High |
| Corrupted Seed | Error correction | High |
| Passphrase Forgotten | No recovery | Very High |