<p><a href="https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch05.asciidoc#HDWalletFromSeed" rel="nofollow noreferrer">Mastering Bitcoin</a> describes the process of generating the HD wallet seed:</p>
<p>&quot;1. Create a random sequence (entropy) of 128 to 256 bits.&quot;
... 6. The mnemonic code is the sequence of words.
... 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.&quot;
In short - mnemonic code words + salt -&gt; 512 bit see (using HMAC-SHA512)</p>
<p>later:
&quot;HD wallets are created from a single <em>root seed</em>, which is a 128-, 256-, or 512-bit random number. Most commonly, this seed is generated from a mnemonic as detailed in the previous section... The root seed is input into the HMAC-SHA512 algorithm&quot;</p>
<p>1 - What is this &quot;root seed&quot;? It wasn't mentioned before, the author used just the word seed. If it's the same seed as before, and he just suddenly decided to call it 'root seed', why is it 128, 256 or 512 bit long? He had said it was 512. The first section says the seed is the output of the
HMAC-SHA512, the second sections says the seed is its input. But the second section also says &quot;this seed is generated from a mnemonic as detailed in the previous section&quot;. So I'm really confused from his explanation about this seed, or these seeds...
Also from the photos it looks there are two different seeds. First section:
<a href="https://raw.githubusercontent.com/bitcoinbook/bitcoinbook/develop/images/mbc2_0507.png" rel="nofollow noreferrer">https://raw.githubusercontent.com/bitcoinbook/bitcoinbook/develop/images/mbc2_0507.png</a>
Second section:
<a href="https://raw.githubusercontent.com/bitcoinbook/bitcoinbook/develop/images/mbc2_0509.png" rel="nofollow noreferrer">https://raw.githubusercontent.com/bitcoinbook/bitcoinbook/develop/images/mbc2_0509.png</a></p>

CC BY-SA 4.0
2021-10-13T03:35:19.027Z
Not a full answer, but you're probably much better off reading the actual spec documents (BIP39 and BIP32, in this case) than relying on a book which is known to have lots of inaccuracies.
Pieter Wuille
CC BY-SA 4.0
2021-10-13T11:27:10.353Z
See if this helps: https://github.com/libbitcoin/libbitcoin-system/wiki/Addresses-and-HD-Wallets
bordalix
CC BY-SA 4.0
2021-10-13T15:19:16.730Z
@PieterWuille I thought it's like THE recommended book, that everyone reviews and fixes. Thanks!
Rony Tesler
CC BY-SA 4.0
2021-10-13T15:40:09.660Z
It has improved very much since it first came out, but I still wouldn't recommend it for getting more than the big picture. These tiny details are very hard to get right for anyone who isn't an expert.
Pieter Wuille
<bip32-hd-wallets><mnemonic-seed><seed><mastering-bitcoin>
HD wallet root seed length
Rony Tesler
# HD wallet root seed length

(Asked by: username_0 on 2021-10-13)

[Mastering Bitcoin](https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch05.asciidoc#HDWalletFromSeed) describes the process of generating the HD wallet seed:

"1. Create a random sequence (entropy) of 128 to 256 bits."
... 6. The mnemonic code is the sequence of words.
... 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."
In short - mnemonic code words + salt -> 512 bit see (using HMAC-SHA512)

later:
"HD wallets are created from a single *root seed*, which is a 128-, 256-, or 512-bit random number. Most commonly, this seed is generated from a mnemonic as detailed in the previous section... The root seed is input into the HMAC-SHA512 algorithm"

1 - What is this "root seed"? It wasn't mentioned before, the author used just the word seed. If it's the same seed as before, and he just suddenly decided to call it 'root seed', why is it 128, 256 or 512 bit long? He had said it was 512. The first section says the seed is the output of the
HMAC-SHA512, the second sections says the seed is its input. But the second section also says "this seed is generated from a mnemonic as detailed in the previous section". So I'm really confused from his explanation about this seed, or these seeds...
Also from the photos it looks there are two different seeds. First section:
<https://raw.githubusercontent.com/bitcoinbook/bitcoinbook/develop/images/mbc2_0507.png>
Second section:
<https://raw.githubusercontent.com/bitcoinbook/bitcoinbook/develop/images/mbc2_0509.png>

**Tags:** bip32-hd-wallets, mnemonic-seed, seed, mastering-bitcoin

> **Comments:**
> **username_1**: Not a full answer, but you're probably much better off reading the actual spec documents (BIP39 and BIP32, in this case) than relying on a book which is known to have lots of inaccuracies.  
> **username_2**: See if this helps: https://github.com/libbitcoin/libbitcoin-system/wiki/Addresses-and-HD-Wallets  
> **username_0**: @username_1 I thought it's like THE recommended book, that everyone reviews and fixes. Thanks!  
> **username_1**: It has improved very much since it first came out, but I still wouldn't recommend it for getting more than the big picture. These tiny details are very hard to get right for anyone who isn't an expert.  

---

## 0 answers

