<blockquote>
<ol>
<li>What's the relationship between the first pkey/addr (the one with <code>hdkeypath: m/0'/0'/0</code> and the third one <code>m/0'/0'/2</code>?</li>
</ol>
</blockquote>
<p>They are derived from the same parent key. Other than that, there is no relation.</p>
<blockquote>
<p>Does the first key/addr is the master (key) who can recover all later keys generated in the wallet.</p>
</blockquote>
<p>No. They are both child keys of the key at <code>m/0'/0'</code>. The actual master private key (the key at <code>m</code>) is not exportable. There is a HD seed (which is used to generate the master private key at <code>m</code>), but this is only exportable through the <code>dumpwallet</code> RPC.</p>
<blockquote>
<ol start="2">
<li>I only backup the private key of <code>m/0'/0'/2</code>, and removed the whole wallet (the .dat file). Is there a risk of this method? Since I only choose to use this key/addr to receive and store BTC.</li>
</ol>
</blockquote>
<p>Don't do that, you will lose money. When you send Bitcoin, Bitcoin Core will generate new change addresses and send any change there. Those change addresses have different private keys. Without them, you will lose money.</p>
<p>Additionally, by reusing the same address, you are significantly hurting your privacy. By using the same address over and over, anyone you transact with will know how much money you have in your wallet and be able to see all of your incoming and outgoing transactions. This allows anyone to track your spending habits.</p>
<blockquote>
<ol start="3">
<li>I later create a new wallet and restore this <code>m/0'/0'/2</code> key with command <code>importprivkey</code>. and send some BTC to other people, and found it generate a CHANGE addr, so I also backup this new addr's private key too. Since I mainly use this <code>m/0'/0'/2</code> to store long term BTC, and will not use it to make a lot transactions. So I keep the privatekey of <code>m/0'/0'/2</code>, and keep backups priv keys of change addresses it generated, then drop all wallet files. Is this method enough to restore all my balances in a futher day.</li>
</ol>
</blockquote>
<p>Bitcoin Core constantly generates new change addresses. The one time you forget means that you will lose money. If you accidentally request a new address and use it, you will lose money.</p>
<p>In general, backing up individual private keys is not recommended. You should back up the entire wallet.dat file itself. There is no need to export each key individually and back it up in that way. That is a surefire way to lose money at some point in the future.</p>
<blockquote>
<ol start="4">
<li>Can the private key of <code>m/0'/0'/2</code> be used to recover the change addresses' private keys? (What is the master seed of HD wallet, it is the private key of <code>m/0'/0'/0</code>?)</li>
</ol>
</blockquote>
<p>No. The change addresses are unrelated. You would need to have the HD seed mentioned previously in order to derive them.</p>

CC BY-SA 4.0
2021-01-24T06:49:16.190Z
Thanks for the explanations. I may still to only backup private keys. Since I want to make a Paper Wallet (with a new layer of encrypt with a password with AES). Since I won't sent BTC out, so I think I can take the risk of remembering of store the priv-keys of change addresses if I do send BTC out occasionally.
ntk135
CC BY-SA 4.0
2021-01-24T06:49:54.863Z
@ntk135 Bitcoin Core is not the right choice if you want a paper wallet. That may change with future releases, but right now, you're really going to shoot yourself in the foot.
Pieter Wuille
CC BY-SA 4.0
2021-01-24T06:51:20.570Z
@Andrew Chow: The answer to question 4 is technically yes (if you have the xpub of `m/0'/0'` as well), but I don't think this changes anything about the overall advice here: don't rely on any of the details of how the wallet works internally; back up the entire wallet.dat file.
Pieter Wuille
CC BY-SA 4.0
2021-01-24T06:51:58.307Z
@PieterWuille I don't understand. As long as I have the correct private keys (and no matter what wallet these private keys are generated from), I can restore the BTC in any wallet implementations, no?
ntk135
CC BY-SA 4.0
2021-01-24T07:09:22.133Z
@ntk135 It's technically possible, but the chance of making a mistake that will lead to losing money is so high (even for experienced users) that it's not recommended.
ieatpizza
CC BY-SA 4.0
2021-01-24T06:34:44.630Z
2021-01-24T06:34:44.630Z
Ava Chow
<p>I'm new to bitcoin (core) wallet. I recently begin to use it to store some BTC. I'm using the latest version 0.21.0.</p>
<p>I have some basic questions on the keys/addresses it generated. I use command <code>getnewaddress</code> 3 times, the last item has <code>&quot;hdkeypath&quot;: &quot;m/0'/0'/2&quot;</code>, and I dumped its private key, and put some BTC in this address.</p>
<ol>
<li><p>What's the relationship between the first pkey/addr (the one with <code>hdkeypath: m/0'/0'/0</code> and the third one <code>m/0'/0'/2</code>? Does the first key/addr is the master (key) who can recover all later keys generated in the wallet.</p>
</li>
<li><p>I only backup the private key of <code>m/0'/0'/2</code>, and removed the whole wallet (the .dat file). Is there a risk of this method? Since I only choose to use this key/addr to receive and store BTC.</p>
</li>
<li><p>I later create a new wallet and restore this <code>m/0'/0'/2</code> key with command <code>importprivkey</code>. and send some BTC to other people, and found it generate a CHANGE addr, so I also backup this new addr's private key too. Since I mainly use this <code>m/0'/0'/2</code> to store long term BTC, and will not use it to make a lot transactions. So I keep the privatekey of <code>m/0'/0'/2</code>, and keep backups priv keys of change addresses it generated, then drop all wallet files. Is this method enough to restore all my balances in a futher day.</p>
</li>
<li><p>Can the private key of <code>m/0'/0'/2</code> be used to recover the change addresses' private keys? (What is the master seed of HD wallet, it is the private key of <code>m/0'/0'/0</code>?)</p>
</li>
</ol>
<p>Thanks in advance</p>

<bip32-hd-wallets><private-key-import>
Private Keys Relationship in HD Wallets
ntk135
# Private Keys Relationship in HD Wallets

(Asked by: username_0 on 2021-01-24)

I'm new to bitcoin (core) wallet. I recently begin to use it to store some BTC. I'm using the latest version 0.21.0.

I have some basic questions on the keys/addresses it generated. I use command `getnewaddress` 3 times, the last item has `"hdkeypath": "m/0'/0'/2"`, and I dumped its private key, and put some BTC in this address.

1. What's the relationship between the first pkey/addr (the one with `hdkeypath: m/0'/0'/0` and the third one `m/0'/0'/2`? Does the first key/addr is the master (key) who can recover all later keys generated in the wallet.
2. I only backup the private key of `m/0'/0'/2`, and removed the whole wallet (the .dat file). Is there a risk of this method? Since I only choose to use this key/addr to receive and store BTC.
3. I later create a new wallet and restore this `m/0'/0'/2` key with command `importprivkey`. and send some BTC to other people, and found it generate a CHANGE addr, so I also backup this new addr's private key too. Since I mainly use this `m/0'/0'/2` to store long term BTC, and will not use it to make a lot transactions. So I keep the privatekey of `m/0'/0'/2`, and keep backups priv keys of change addresses it generated, then drop all wallet files. Is this method enough to restore all my balances in a futher day.
4. Can the private key of `m/0'/0'/2` be used to recover the change addresses' private keys? (What is the master seed of HD wallet, it is the private key of `m/0'/0'/0`?)

Thanks in advance

**Tags:** bip32-hd-wallets, private-key-import


---

## 1 answers

### Answer by username_1 on 2021-01-24. Score: 2 | Accepted answer

> 1. What's the relationship between the first pkey/addr (the one with `hdkeypath: m/0'/0'/0` and the third one `m/0'/0'/2`?

They are derived from the same parent key. Other than that, there is no relation.

> Does the first key/addr is the master (key) who can recover all later keys generated in the wallet.

No. They are both child keys of the key at `m/0'/0'`. The actual master private key (the key at `m`) is not exportable. There is a HD seed (which is used to generate the master private key at `m`), but this is only exportable through the `dumpwallet` RPC.

> 2. I only backup the private key of `m/0'/0'/2`, and removed the whole wallet (the .dat file). Is there a risk of this method? Since I only choose to use this key/addr to receive and store BTC.

Don't do that, you will lose money. When you send Bitcoin, Bitcoin Core will generate new change addresses and send any change there. Those change addresses have different private keys. Without them, you will lose money.

Additionally, by reusing the same address, you are significantly hurting your privacy. By using the same address over and over, anyone you transact with will know how much money you have in your wallet and be able to see all of your incoming and outgoing transactions. This allows anyone to track your spending habits.

> 3. I later create a new wallet and restore this `m/0'/0'/2` key with command `importprivkey`. and send some BTC to other people, and found it generate a CHANGE addr, so I also backup this new addr's private key too. Since I mainly use this `m/0'/0'/2` to store long term BTC, and will not use it to make a lot transactions. So I keep the privatekey of `m/0'/0'/2`, and keep backups priv keys of change addresses it generated, then drop all wallet files. Is this method enough to restore all my balances in a futher day.

Bitcoin Core constantly generates new change addresses. The one time you forget means that you will lose money. If you accidentally request a new address and use it, you will lose money.

In general, backing up individual private keys is not recommended. You should back up the entire wallet.dat file itself. There is no need to export each key individually and back it up in that way. That is a surefire way to lose money at some point in the future.

> 4. Can the private key of `m/0'/0'/2` be used to recover the change addresses' private keys? (What is the master seed of HD wallet, it is the private key of `m/0'/0'/0`?)

No. The change addresses are unrelated. You would need to have the HD seed mentioned previously in order to derive them.

> **Comments:**
> **username_0**: Thanks for the explanations. I may still to only backup private keys. Since I want to make a Paper Wallet (with a new layer of encrypt with a password with AES). Since I won't sent BTC out, so I think I can take the risk of remembering of store the priv-keys of change addresses if I do send BTC out occasionally.  
> **username_2**: @username_0 Bitcoin Core is not the right choice if you want a paper wallet. That may change with future releases, but right now, you're really going to shoot yourself in the foot.  
> **username_2**: @Andrew username_1: The answer to question 4 is technically yes (if you have the xpub of `m/0'/0'` as well), but I don't think this changes anything about the overall advice here: don't rely on any of the details of how the wallet works internally; back up the entire wallet.dat file.  
> **username_0**: @username_2 I don't understand. As long as I have the correct private keys (and no matter what wallet these private keys are generated from), I can restore the BTC in any wallet implementations, no?  
> **username_3**: @username_0 It's technically possible, but the chance of making a mistake that will lead to losing money is so high (even for experienced users) that it's not recommended.  

---

