<p>Conversion from a HD seed to a master private key is specified by <a href="https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#Master_key_generation" rel="nofollow noreferrer">BIP 32</a>.</p>

<p>It is done by computing a HMAC-SHA512 where the key is the text <code>Bitcoin seed</code> and the data is the HD seed itself. The first 32 bytes (256 bits) is the master private key. The last 32 byte is the chaincode for the master key.</p>

CC BY-SA 4.0
2020-01-21T17:07:27.183Z
2020-01-21T17:07:27.183Z
Ava Chow
<p>I am testing a Bitcoin application, and to test the signing of transactions I use regtest with Bitcoin Core. But I have some problems, the first I have already published in a <a href="https://bitcoin.stackexchange.com/questions/92716/why-keys-generated-in-bitcoin-core-mismatch-that-from-online-generators-despite">question</a> that I still have no convenient answer.</p>

<p>But the problem generated by this new question is:</p>

<p>If a Bitcoin Core wallet can be saved and loaded with just the hdseed, then the extended private masterkey is calculated from it. Then, how Bitcoin Core calculate that?</p>

<p>Thanks in advance</p>

<bitcoin-core><private-key><bip32-hd-wallets>
How Bitcoin Core calculate extended private masterkey from hdseed
wic
# How Bitcoin Core calculate extended private masterkey from hdseed

(Asked by: username_0 on 2020-01-21)

I am testing a Bitcoin application, and to test the signing of transactions I use regtest with Bitcoin Core. But I have some problems, the first I have already published in a [question](https://bitcoin.stackexchange.com/questions/92716/why-keys-generated-in-bitcoin-core-mismatch-that-from-online-generators-despite) that I still have no convenient answer.

But the problem generated by this new question is:

If a Bitcoin Core wallet can be saved and loaded with just the hdseed, then the extended private masterkey is calculated from it. Then, how Bitcoin Core calculate that?

Thanks in advance

**Tags:** bitcoin-core, private-key, bip32-hd-wallets


---

## 1 answers

### Answer by username_1 on 2020-01-21. Score: 2

Conversion from a HD seed to a master private key is specified by [BIP 32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#Master_key_generation).

It is done by computing a HMAC-SHA512 where the key is the text `Bitcoin seed` and the data is the HD seed itself. The first 32 bytes (256 bits) is the master private key. The last 32 byte is the chaincode for the master key.


---

