Deterministic wallets use a single seed phrase (a sequence of words, usually 12, 18, or 24 words) to generate multiple private keys in a structured and repeatable way. The process follows a hierarchical deterministic (HD) structure, typically defined by BIP-32, BIP-39, and BIP-44 standards. Here’s how they work:
1. Seed Generation (BIP-39)
- The wallet generates a mnemonic phrase (seed phrase) using BIP-39.
- This phrase is converted into a binary seed using a hashing function (PBKDF2 with SHA-512).
- The resulting 512-bit seed acts as the root of the deterministic key tree.
2. Master Key and Chain Code (BIP-32)
- The 512-bit seed is fed into the HMAC-SHA512 function with the key
"Bitcoin seed"
(or similar for other cryptocurrencies). - This produces:
- Master private key (first 256 bits).
- Master chain code (remaining 256 bits) for deterministic derivation.
3. Key Derivation (Child Keys)
- Using the master key, child keys are generated in a hierarchical structure.
- Each key is derived using: ChildPrivateKey=ParentPrivateKey+HMAC−SHA512(ChainCode,Index)
- The index allows deterministic derivation of multiple addresses.
4. Hierarchical Wallet Structure (BIP-44)
A wallet follows a path structure for different cryptocurrencies and accounts.
The standard derivation path follows:
m / purpose’ / coin_type’ / account’ / change / address_index
address_index
: The unique key index for each address
m
: Master key
purpose'
: Typically 44′ for BIP-44 wallets
coin_type'
: Defines the cryptocurrency (e.g., 0 for Bitcoin, 60 for Ethereum)
account'
: Different accounts within the wallet
change
: 0 for external addresses (receiving), 1 for internal (change addresses)
5. Public Key Derivation (Extended Public Key)
- Using elliptic curve cryptography (ECC), the private key is converted into a public key.
- The wallet can generate multiple receiving addresses without exposing private keys using xPub (Extended Public Key).
Advantages of Deterministic Wallets
- Backup Once: The mnemonic phrase backs up all derived keys.
- Infinite Keys: A single seed can generate an unlimited number of addresses.
- Privacy: HD wallets can generate new addresses for each transaction.
Conclusion
Deterministic wallets use cryptographic functions and structured key derivation to generate multiple keys from a single seed. This method enhances security, usability, and backup efficiency.