How to create HD Wallet?

Tran B. V. Son
2 min readDec 6, 2018

--

Generating Mnemonic Words

  1. Create a random sequence (entropy) of 128 to 256 bits.
  2. Create a checksum of the random sequence by taking the first (entropy-length/32) bits of its SHA256 hash.
  3. Add the checksum to the end of the random sequence.
  4. Split the result into 11-bit length segments.
  5. Map each 11-bit value to a word from the predefined dictionary of 2048 words.
  6. 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

Creating master keys from root seed

Private child key derivation

Public child key derivation

Source: Mastering Bitcoin

--

--

No responses yet