ย
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 |