<p>They correspond to specific record types commonly found in older legacy wallet, specificaly:</p>
<pre><code>0x02: KEY - Private key entries (in very old or unencrypted wallets, these store the pubkey and corresponding private key).

0x03: WKEY - An older, now-deprecated record type related to wallet keys. It was used in very early wallet versions and isn’t typically seen in modern wallets.

0x05: NAME - Address book entries (the &quot;label&quot; or &quot;name&quot; associated with a particular Bitcoin address).

0x07: POOL - Keypool entries (pre-generated addresses/keys waiting to be used).

0x09: ACC - Account records (from older wallet versions that supported accounts, now deprecated).

0x0a: ACENTRY - Account entry records, detailing transactions or balances associated with named accounts (also deprecated).

0x0c: CSCRIPT - Storing redeem scripts (used for P2SH addresses or other special script conditions).

0x12: WTX (Transaction) - Full transaction records relevant to the wallet’s balance and history.

Grouping by Record Type:

Keys (private keys): Look for 0x02 (and sometimes 0x03 in very old wallets).

Address-related metadata: 0x05 (NAME) stores address labels.

Keypool and Account Info: 0x07 (POOL) and 0x09/0x0a (ACC/ACENTRY) for pre-HD, account-based workflows.

Scripts: 0x0c (CSCRIPT) for redeem scripts.

Transactions: 0x12 (WTX) for recorded wallet transactions.
</code></pre>
<p>For more information you can check this old python script that give information about wallet.dat file, you can also look into the source code</p>
<p><a href="https://github.com/jackjack-jj/pywallet" rel="nofollow noreferrer">https://github.com/jackjack-jj/pywallet</a></p>

CC BY-SA 4.0
2024-12-18T15:13:25.397Z
2024-12-18T15:13:25.397Z
Saxtheowl
<p>I have python script to dump wallet.dat details to json+hex file. It operates with bsddb3 library. There are keys and values. They can be divided into:</p>
<ul>
<li>addresses</li>
<li>keys (private keys?)</li>
<li>transactions</li>
<li>metadata</li>
</ul>
<p>depending on the first byte.</p>
<p>I have: 02, 03, 05, 07, 09, 0a, 0c, 12 as the first bytes for all keys in some encrypted wallet.</p>
<p>What does these first bytes mean and how should I divide types of keys into groups by this first byte?</p>

<bitcoin-core><python><wallet.dat><private-key-export>
Bitcoin Core wallet.dat keys details
pbies
# Bitcoin Core wallet.dat keys details

(Asked by: username_0 on 2024-12-17)

I have python script to dump wallet.dat details to json+hex file. It operates with bsddb3 library. There are keys and values. They can be divided into:

* addresses
* keys (private keys?)
* transactions
* metadata

depending on the first byte.

I have: 02, 03, 05, 07, 09, 0a, 0c, 12 as the first bytes for all keys in some encrypted wallet.

What does these first bytes mean and how should I divide types of keys into groups by this first byte?

**Tags:** bitcoin-core, python, wallet.dat, private-key-export


---

## 1 answers

### Answer by username_1 on 2024-12-18. Score: 1 | Accepted answer

They correspond to specific record types commonly found in older legacy wallet, specificaly:

```
0x02: KEY - Private key entries (in very old or unencrypted wallets, these store the pubkey and corresponding private key).

0x03: WKEY - An older, now-deprecated record type related to wallet keys. It was used in very early wallet versions and isn’t typically seen in modern wallets.

0x05: NAME - Address book entries (the "label" or "name" associated with a particular Bitcoin address).

0x07: POOL - Keypool entries (pre-generated addresses/keys waiting to be used).

0x09: ACC - Account records (from older wallet versions that supported accounts, now deprecated).

0x0a: ACENTRY - Account entry records, detailing transactions or balances associated with named accounts (also deprecated).

0x0c: CSCRIPT - Storing redeem scripts (used for P2SH addresses or other special script conditions).

0x12: WTX (Transaction) - Full transaction records relevant to the wallet’s balance and history.

Grouping by Record Type:

Keys (private keys): Look for 0x02 (and sometimes 0x03 in very old wallets).

Address-related metadata: 0x05 (NAME) stores address labels.

Keypool and Account Info: 0x07 (POOL) and 0x09/0x0a (ACC/ACENTRY) for pre-HD, account-based workflows.

Scripts: 0x0c (CSCRIPT) for redeem scripts.

Transactions: 0x12 (WTX) for recorded wallet transactions.

```

For more information you can check this old python script that give information about wallet.dat file, you can also look into the source code

<https://github.com/jackjack-jj/pywallet>


---

