How to create HD Wallet?
2 min readDec 6, 2018
Generating Mnemonic Words
- Create a random sequence (entropy) of 128 to 256 bits.
- Create a checksum of the random sequence by taking the first (entropy-length/32) bits of its SHA256 hash.
- Add the checksum to the end of the random sequence.
- Split the result into 11-bit length segments.
- Map each 11-bit value to a word from the predefined dictionary of 2048 words.
- The mnemonic code is the sequence of words. (12 words)
Mnemonic to Seed
7. The first parameter to the PBKDF2 key-stretching function is the mnemonic produced from step 6.
8. The second parameter to the PBKDF2 key-stretching function is a salt. The salt is composed of the string constant mnemonic
concatenated with an optional user-supplied passphrase string.
9. PBKDF2 stretches the mnemonic and salt parameters using 2048 rounds of hashing with the HMAC-SHA512 algorithm, producing a 512-bit value as its final output. That 512-bit value is the seed.
From Seed To HD Wallet
Creating master keys from the root seed
Private child key derivation
Public child key derivation
Source: Mastering Bitcoin