<p>AFAIK there isn't any documentation of <code>dumpwallet</code>'s output. You need to read the source code to know. I suppose I can just document it here though.</p>
<p>The <code>dumpwallet</code> output contains comments. Comments are prefixed by a <code>#</code>. This can be found at the beginning of a line or in the middle. Anything on that line following the <code>#</code> is a comment and will not be parsed by <code>importwallet</code>. Comments are used to provide additional information to the user reading the <code>dumpwallet</code> output but prevent the <code>importwallet</code> parser from doing anything with the data in the comment.</p>
<p>The first 4 lines are just some extra information to the user to know which version created the dump and at what time. It includes the current clock time as well as the time and hash of the current best block.</p>
<p>For HD wallets, this is followed by the extended master private key.</p>
<p>After that, each line lists out an individual private key and some metadata about that private key. The private key will be encoded using the Wallet Import Format.</p>
<p>The private key will then be followed by a timestamp. This timestamp is in UTC time and is the time that the private key was created and added to the wallet.</p>
<p>Each private key will have one of the following metadata fields: <code>label</code>, <code>hdseed</code>, <code>reserve</code>, <code>inactivehdseed</code>, or `change.</p>
<ul>
<li><code>label</code>: This is a label assigned to one of the addresses for this private key. Since a single private key can have multiple addresses, and each of those addresses a different label, this just gets one of this labels. It's a holdover from when one private key corresponded to one address. All receiving addresses will have a <code>label</code> even if it does not have a label. For those addresses, the label is the empty string so you may see <code>label=</code> a lot.</li>
<li><code>hdseed</code>: This private keys is the current active HD seed. You will always see this field as <code>hdseed=1</code>. The HD seed is a <a href="https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#Master_key_generation" rel="noreferrer">BIP 32</a> seed. Bitcoin Core stores this as a private key and it is therefore indistinguishable from other private keys. This HD seed is used to produce the extended master private key found earlier. It may also be used to derive many of the other private keys in this wallet. There should only be one key with <code>hdseed=1</code>.</li>
<li><code>reserve</code>: This indicates that the private key is part of the keypool. You will always see this as <code>reserve=1</code>. The key has not been requested for use as a receiving address nor as a change address, it is in reserve in the keypool.</li>
<li><code>inactivehdseed</code>: This private key was a HD seed previously used by the wallet but is no longer the currently active HD seed. You will always see this as <code>inactivehdseed=1</code>. It is the same meaning as the key with <code>hdseed=1</code> except it is not currently active.</li>
<li><code>change</code>: This key is no longer in the keypool and it's address is not a receiving address. The assumption is that such addresses are change addresses. So this key is marked as being change by having this metadata field. You will always see it as <code>change=1</code>.</li>
</ul>
<p>Following the metadata, on the same line, will be a comment with some additional metadata that may be useful to the user but will not be parsed by <code>importwallet</code>. This will have 2 fields: <code>addr</code> and <code>hdkeypath</code>.</p>
<ul>
<li><code>addr</code>: This is a comma separate list of addresses that have been used for this private key. Since a single private key can have multiple addresses, you may see multiple addresses in this field.</li>
<li><code>hdkeypath</code>: This is a string representing the <a href="https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#the-key-tree" rel="noreferrer">BIP 32 derivation path</a> for this private key. In cases where there is only one key marked as <code>hdseed=1</code>, you can derive this private key by using the extended master private key at the top of the file and then deriving from it the key with this derivation path. When there are multiple HD seeds in a wallet (i.e. when there are <code>inactivehdseed=1</code> keys), it is not possible to know which seed this key was derived from without trying to derive from them all.</li>
</ul>
<p>After each of the private keys is listed, you will see lines for scripts stored in the wallet. This is similar to how private keys are listed.</p>
<p>Each script is written out in hexadecimal. The script is then followed by a timestamp indicating the time that the script was added to the wallet. It will then be followed by <code>script=1</code> to indicate that this line is for a script. Lastly there will be a comment containing an <code>addr</code> field. This address will be the P2SH address for this script.</p>
<p>At the end of the file is a comment <code>End of dump</code> to indicate the end of the wallet dump.</p>
<hr />
<p>When you use <code>dumpwallet</code>, you should expect to see several thousand lines. This is because Bitcoin Core, by default, has a keypool of 1000 receiving keys and 1000 change keys. For a newly created wallet, there will be 2000 key lines.</p>
<p>If you have not imported any scripts, you should have the same number of key lines as script lines. This is because each key has a segwit script. This is an artifact of how the Bitcoin Core wallet supports segwit.</p>
<p>If you have imported any scripts such as multisig scripts or addresses which are not yours, then you will see those scripts in the script lines as well.</p>

CC BY-SA 4.0
2021-03-04T16:36:53.713Z
Andrew, under what circumstances will there be reserve=1 keys? Do they have a practical use today?
Donn Lee
CC BY-SA 4.0
2021-03-04T18:09:14.390Z
@DonnLee There will always be `reserve=1` keys (except for descriptor wallets, but that's an entirely different thing). They are useful today and are still important.
Ava Chow
CC BY-SA 4.0
2021-03-04T23:36:22.683Z
`reserve` addresses: https://bitcoin.stackexchange.com/questions/96982/what-is-the-meaning-of-change-and-reserve-in-a-bitcoin-core-wallet-dump
Donn Lee
CC BY-SA 4.0
2021-01-23T18:57:30.563Z
2021-01-23T18:57:30.563Z
Ava Chow
<p>Where do I find complete documentation on what the console command &quot;dumpwallet&quot; output means?<br />
Sample of my testnet output:</p>
<pre><code># Wallet dump created by Bitcoin v0.21.0   
# * Created on 2021-01-21T16:59:50Z   
# * Best block at time of backup was 1905234 (00000000e26170d0f846a334a1bfdfebe8da906c5),   
#   mined on 2021-01-21T17:05:05Z    

# extended private masterkey: tpR2efnJMh85ufpQcYSTwrrKrYJ   

cTdH4SbvTR 1970-01-01T00:00:01Z label= # addr=mnb8RSpTqvhLh8Q6,2MudYFE2awqc,tbvhpur8zf35ql3yx5h9nu   
cRaKzuR9MCVwAxVa3aAZrVh15YbV 2019-08-26T01:19:00Z reserve=1 # addr=tb1q3qc52q hdkeypath=m/0'/0'/222'   
cT2ozo5xcj6iCe4dTfywan3qJnib 2019-08-26T01:19:00Z hdseed=1 # addr=tb1qzqtu25qsue0a5pp3hg8lkftclf8ds   
cNb2K9tUhQaeXiVz2Jt2Wq9DMLdf 2019-08-26T01:19:00Z reserve=1 # addr=tb14d7lx hdkeypath=m/0'/0'/117'   

.....4040 lines   
# End of dump  
</code></pre>
<p>What's &quot;hdkeypath&quot;?<br />
What's &quot;reserve&quot; ?<br />
What's &quot;hdseed&quot;?<br />
Why does &quot;addr&quot; sometimes have 1 address and sometimes 3 addresses?<br />
Why does my dump have 4040 lines?<br />
(for purposes of formatting &amp; discretion, all addrs/keys are mangled)</p>
<p>This is the best I could find. It offers no detail about the output:<br />
<a href="http://developer.bitcoin.org/reference/rpc/dumpwallet.html" rel="noreferrer">dumpwallet</a></p>

<bitcoin-core><testnet>
dumpwallet output documentation & explanation?
JDOaktown
# dumpwallet output documentation & explanation?

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

Where do I find complete documentation on what the console command "dumpwallet" output means?  
Sample of my testnet output:

```
# Wallet dump created by Bitcoin v0.21.0   
# * Created on 2021-01-21T16:59:50Z   
# * Best block at time of backup was 1905234 (00000000e26170d0f846a334a1bfdfebe8da906c5),   
#   mined on 2021-01-21T17:05:05Z    

# extended private masterkey: tpR2efnJMh85ufpQcYSTwrrKrYJ   

cTdH4SbvTR 1970-01-01T00:00:01Z label= # addr=mnb8RSpTqvhLh8Q6,2MudYFE2awqc,tbvhpur8zf35ql3yx5h9nu   
cRaKzuR9MCVwAxVa3aAZrVh15YbV 2019-08-26T01:19:00Z reserve=1 # addr=tb1q3qc52q hdkeypath=m/0'/0'/222'   
cT2ozo5xcj6iCe4dTfywan3qJnib 2019-08-26T01:19:00Z hdseed=1 # addr=tb1qzqtu25qsue0a5pp3hg8lkftclf8ds   
cNb2K9tUhQaeXiVz2Jt2Wq9DMLdf 2019-08-26T01:19:00Z reserve=1 # addr=tb14d7lx hdkeypath=m/0'/0'/117'   

.....4040 lines   
# End of dump  

```

What's "hdkeypath"?  
What's "reserve" ?  
What's "hdseed"?  
Why does "addr" sometimes have 1 address and sometimes 3 addresses?  
Why does my dump have 4040 lines?  
(for purposes of formatting & discretion, all addrs/keys are mangled)

This is the best I could find. It offers no detail about the output:  
[dumpwallet](http://developer.bitcoin.org/reference/rpc/dumpwallet.html)

**Tags:** bitcoin-core, testnet


---

## 1 answers

### Answer by username_1 on 2021-01-23. Score: 6 | Accepted answer

AFAIK there isn't any documentation of `dumpwallet`'s output. You need to read the source code to know. I suppose I can just document it here though.

The `dumpwallet` output contains comments. Comments are prefixed by a `#`. This can be found at the beginning of a line or in the middle. Anything on that line following the `#` is a comment and will not be parsed by `importwallet`. Comments are used to provide additional information to the user reading the `dumpwallet` output but prevent the `importwallet` parser from doing anything with the data in the comment.

The first 4 lines are just some extra information to the user to know which version created the dump and at what time. It includes the current clock time as well as the time and hash of the current best block.

For HD wallets, this is followed by the extended master private key.

After that, each line lists out an individual private key and some metadata about that private key. The private key will be encoded using the Wallet Import Format.

The private key will then be followed by a timestamp. This timestamp is in UTC time and is the time that the private key was created and added to the wallet.

Each private key will have one of the following metadata fields: `label`, `hdseed`, `reserve`, `inactivehdseed`, or `change.

* `label`: This is a label assigned to one of the addresses for this private key. Since a single private key can have multiple addresses, and each of those addresses a different label, this just gets one of this labels. It's a holdover from when one private key corresponded to one address. All receiving addresses will have a `label` even if it does not have a label. For those addresses, the label is the empty string so you may see `label=` a lot.
* `hdseed`: This private keys is the current active HD seed. You will always see this field as `hdseed=1`. The HD seed is a [BIP 32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#Master_key_generation) seed. Bitcoin Core stores this as a private key and it is therefore indistinguishable from other private keys. This HD seed is used to produce the extended master private key found earlier. It may also be used to derive many of the other private keys in this wallet. There should only be one key with `hdseed=1`.
* `reserve`: This indicates that the private key is part of the keypool. You will always see this as `reserve=1`. The key has not been requested for use as a receiving address nor as a change address, it is in reserve in the keypool.
* `inactivehdseed`: This private key was a HD seed previously used by the wallet but is no longer the currently active HD seed. You will always see this as `inactivehdseed=1`. It is the same meaning as the key with `hdseed=1` except it is not currently active.
* `change`: This key is no longer in the keypool and it's address is not a receiving address. The assumption is that such addresses are change addresses. So this key is marked as being change by having this metadata field. You will always see it as `change=1`.

Following the metadata, on the same line, will be a comment with some additional metadata that may be useful to the user but will not be parsed by `importwallet`. This will have 2 fields: `addr` and `hdkeypath`.

* `addr`: This is a comma separate list of addresses that have been used for this private key. Since a single private key can have multiple addresses, you may see multiple addresses in this field.
* `hdkeypath`: This is a string representing the [BIP 32 derivation path](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#the-key-tree) for this private key. In cases where there is only one key marked as `hdseed=1`, you can derive this private key by using the extended master private key at the top of the file and then deriving from it the key with this derivation path. When there are multiple HD seeds in a wallet (i.e. when there are `inactivehdseed=1` keys), it is not possible to know which seed this key was derived from without trying to derive from them all.

After each of the private keys is listed, you will see lines for scripts stored in the wallet. This is similar to how private keys are listed.

Each script is written out in hexadecimal. The script is then followed by a timestamp indicating the time that the script was added to the wallet. It will then be followed by `script=1` to indicate that this line is for a script. Lastly there will be a comment containing an `addr` field. This address will be the P2SH address for this script.

At the end of the file is a comment `End of dump` to indicate the end of the wallet dump.

---

When you use `dumpwallet`, you should expect to see several thousand lines. This is because Bitcoin Core, by default, has a keypool of 1000 receiving keys and 1000 change keys. For a newly created wallet, there will be 2000 key lines.

If you have not imported any scripts, you should have the same number of key lines as script lines. This is because each key has a segwit script. This is an artifact of how the Bitcoin Core wallet supports segwit.

If you have imported any scripts such as multisig scripts or addresses which are not yours, then you will see those scripts in the script lines as well.

> **Comments:**
> **username_2**: Andrew, under what circumstances will there be reserve=1 keys? Do they have a practical use today?  
> **username_1**: @username_2 There will always be `reserve=1` keys (except for descriptor wallets, but that's an entirely different thing). They are useful today and are still important.  
> **username_2**: `reserve` addresses: https://bitcoin.stackexchange.com/questions/96982/what-is-the-meaning-of-change-and-reserve-in-a-bitcoin-core-wallet-dump  

---

