<blockquote>
<ol>
<li>what is exactly the meaning of <code>reserve</code> and <code>change</code>? My guess is that <code>reserve</code> are normal reception addresses and <code>change</code> are, well, change, but I'm still wondering if there's some meaning more specific to Bitcoin Core.</li>
</ol>
</blockquote>
<p><code>reserve</code> means that the key is in the keypool and has not been used yet. This is used for both change and receiving addresses as there are keypools for both.</p>
<p><code>change</code> means that the key is used for change addresses.</p>
<blockquote>
<ol start="2">
<li>I thought that change addresses were derived with a different path, like the reception addresses all end with <code>../0/{index}</code> and change with <code>../1/{index}</code>, or is Bitcoin Core doing things differently of say Electrum?</li>
</ol>
</blockquote>
<p>They are. Bitcoin Core uses <code>m/0'/0'/i'</code> for receiving addresses and <code>m/0'/1'/i'</code> for change. However if you have an older Bitcoin Core wallet, this split doesn't exist and there's only one keypool. But if you are using <code>sethdseed</code>, that shouldn't effect you.</p>
<blockquote>
<ol start="3">
<li>Besides I wonder how to generate 2 different key pairs with the same master key and path, could I have generate the <code>change</code> address with libwally too?</li>
</ol>
</blockquote>
<p>There aren't 2 different key pairs with the same master key and path. Bitcoin Core doesn't do this, and that is not possible with BIP 32 (or any BIP).</p>

CC BY-SA 4.0
2020-07-15T08:21:27.293Z
Thanks for the answer, I made a test again and this time I indeed only have one address with the same path in BC wallet, I think I messed up last time and didn't add the `blank` option to `createwallet`. I was thinking it was indeed impossible to have 2 key pairs with the same master key and path, so I'm relieved my wallet didn't break the laws of mathematics :)
Sosthène
CC BY-SA 4.0
2020-07-13T16:19:42.617Z
2020-07-13T16:19:42.617Z
Ava Chow
<p>I'm using <a href="https://github.com/ElementsProject/libwally-core" rel="nofollow noreferrer">libwally</a> to derive addresses from an extended private key. I shared the seed with Bitcoin Core (loaded it in a blank wallet with <code>sethdseed</code>), and noticed that there are 2 addresses in the dump of the wallet file under the same derivation path, one is labeled <code>reserve=1</code> and is the same that I derive with libwally, the other is labeled <code>change=1</code> and is different.</p>
<p>I have a few questions about this:</p>
<ol>
<li>what is exactly the meaning of <code>reserve</code> and <code>change</code>? My guess is that <code>reserve</code> are normal reception addresses and <code>change</code> are, well, change, but I'm still wondering if there's some meaning more specific to Bitcoin Core.</li>
<li>I thought that change addresses were derived with a different path, like the reception addresses all end with <code>../0/{index}</code> and change with <code>../1/{index}</code>, or is Bitcoin Core doing things differently of say Electrum?</li>
<li>Besides I wonder how to generate 2 different key pairs with the same master key and path, could I have generate the <code>change</code> address with libwally too?</li>
</ol>
<p><strong>[EDIT]</strong> After doing it one more time I only have one address with the same path in the dump file of Bitcoin Core, so I guess I made a mistake last time, I'll explain it here in case it helps:
To create a wallet with a seed you choose yourself you need 2 commands, <code>createwallet</code> and <code>sethdseed</code>. Besides the required <code>wallet_name</code>, <code>createwallet</code> also takes an optional <code>blank</code> argument. By default it is <code>false</code>, and the command will use a random seed to generate a key pool. But since we want to use our own seed, we need to set it to <code>true</code>. If you dump the newly created wallet, it will be blank, no master key, no key pool, nothing. Then only you can <code>sethdseed</code> with a 32B seed encoded in wif format.
I was having 2 keys under the same derivation path because I first created a wallet with a random seed, and then added my own with <code>sethdseed</code>, so I was having 2 key pools in my dump file. As Andrew said in the answer, it is impossible to have 2 different key pairs with the same master key and path.</p>

<bitcoin-core><wallet><bip32-hd-wallets><libwally>
What is the meaning of 'change' and 'reserve' in a Bitcoin Core wallet dump?
Sosthène
# What is the meaning of 'change' and 'reserve' in a Bitcoin Core wallet dump?

(Asked by: username_0 on 2020-07-13)

I'm using [libwally](https://github.com/ElementsProject/libwally-core) to derive addresses from an extended private key. I shared the seed with Bitcoin Core (loaded it in a blank wallet with `sethdseed`), and noticed that there are 2 addresses in the dump of the wallet file under the same derivation path, one is labeled `reserve=1` and is the same that I derive with libwally, the other is labeled `change=1` and is different.

I have a few questions about this:

1. what is exactly the meaning of `reserve` and `change`? My guess is that `reserve` are normal reception addresses and `change` are, well, change, but I'm still wondering if there's some meaning more specific to Bitcoin Core.
2. I thought that change addresses were derived with a different path, like the reception addresses all end with `../0/{index}` and change with `../1/{index}`, or is Bitcoin Core doing things differently of say Electrum?
3. Besides I wonder how to generate 2 different key pairs with the same master key and path, could I have generate the `change` address with libwally too?

**[EDIT]** After doing it one more time I only have one address with the same path in the dump file of Bitcoin Core, so I guess I made a mistake last time, I'll explain it here in case it helps:
To create a wallet with a seed you choose yourself you need 2 commands, `createwallet` and `sethdseed`. Besides the required `wallet_name`, `createwallet` also takes an optional `blank` argument. By default it is `false`, and the command will use a random seed to generate a key pool. But since we want to use our own seed, we need to set it to `true`. If you dump the newly created wallet, it will be blank, no master key, no key pool, nothing. Then only you can `sethdseed` with a 32B seed encoded in wif format.
I was having 2 keys under the same derivation path because I first created a wallet with a random seed, and then added my own with `sethdseed`, so I was having 2 key pools in my dump file. As Andrew said in the answer, it is impossible to have 2 different key pairs with the same master key and path.

**Tags:** bitcoin-core, wallet, bip32-hd-wallets, libwally


---

## 1 answers

### Answer by username_1 on 2020-07-13. Score: 2 | Accepted answer

> 1. what is exactly the meaning of `reserve` and `change`? My guess is that `reserve` are normal reception addresses and `change` are, well, change, but I'm still wondering if there's some meaning more specific to Bitcoin Core.

`reserve` means that the key is in the keypool and has not been used yet. This is used for both change and receiving addresses as there are keypools for both.

`change` means that the key is used for change addresses.

> 2. I thought that change addresses were derived with a different path, like the reception addresses all end with `../0/{index}` and change with `../1/{index}`, or is Bitcoin Core doing things differently of say Electrum?

They are. Bitcoin Core uses `m/0'/0'/i'` for receiving addresses and `m/0'/1'/i'` for change. However if you have an older Bitcoin Core wallet, this split doesn't exist and there's only one keypool. But if you are using `sethdseed`, that shouldn't effect you.

> 3. Besides I wonder how to generate 2 different key pairs with the same master key and path, could I have generate the `change` address with libwally too?

There aren't 2 different key pairs with the same master key and path. Bitcoin Core doesn't do this, and that is not possible with BIP 32 (or any BIP).

> **Comments:**
> **username_0**: Thanks for the answer, I made a test again and this time I indeed only have one address with the same path in BC wallet, I think I messed up last time and didn't add the `blank` option to `createwallet`. I was thinking it was indeed impossible to have 2 key pairs with the same master key and path, so I'm relieved my wallet didn't break the laws of mathematics :)  

---

