HD wallet seed master privK/chainCode misunderstanding

(Grog) #1

According to our dear book mastering bitcoin, I understand via HD Wallet section that everything came from a seed.
From it and an hashing fonction we obtain the master private key and a master chain code.
We can go one step deeper by using another time the same hashing function with

  • the master public key derieved from the master private key

  • the master chain code

  • a number called index.

By iterate this way we can go “deeper” each time.

According to bitcore doc, I’m currently checking HDKeys because it’s clearly related.
The problem I encountered is that I don’t success to “match” what I had understand and what I read here bitcore.io/api/lib/hd-keys

We generate an hdPrivateKey and hdPublicKey object which contains parameters, I’m kinda lost :confused:
Where is the seed ? It isn’t what we had to keep for backup all things derivate from the highest level ?
Or we should consider that the only important thing is the hdPrivateKey instance ?
I checked https://github.com/bitpay/bitcore-mnemonic
If I understand correctly, by this code :

var Mnemonic = require('bitcore-mnemonic'); var code = new Mnemonic(Mnemonic.Words.SPANISH); code.toString(); // natal hada sutil año sólido papel jamón combate aula flota ver esfera... var xpriv = code.toHDPrivateKey();

There is a seed somewhere that we don’t see, we are able to get and instance of hdPrivateKey by the mnemonic words so there is the HMAC-512 hashing function here.
It’s by default 128 bits entropy or it’s related to the lenght of the passphrase https://bitcore.io/api/mnemonic/#Mnemonic+toSeed
We can assume that we are on the highest “level” or “index” ?

1 Like