<p><code>wallet.dat</code>, <code>addr.dat</code> and <code>blkindex.dat</code> are Berkeley Database files. They can be read using standard tools, but aren't human readable by themselves. <code>blk0001.dat</code> (and additional blk000n.dat blocks) contain the blockchain itself, that's just a binary concatenation of the blocks.</p>
<ul>
<li><code>wallet.dat</code> contains your private keys, your address book, a copy of the transactions that send coins from or to one of your addresses, accounts, reserve keys, personal settings, and a pointer to the current best block.</li>
<li><code>addr.dat</code> contains IP addresses of peers, both those you've connected to yourself or those you've only heard about. It has been replaced by peers.dat since 0.7.0</li>
<li><code>peers.dat</code> contains the same information as addr.dat, but using an efficient custom format.</li>
<li><code>blkindex.dat</code> contains an index of the blocks and transactions that can be found in all the <code>blk000n.dat</code> files.</li>
</ul>
<p>I don't know about any standalone tools that convert <code>addr.dat</code> and <code>blkindex.dat</code> to human-readable form, although <a href="http://blockexplorer.com" rel="nofollow noreferrer">blockexplorer.com</a> can be used to inspect the blockchain, and <code>addr.dat</code> just contains IP addresses.</p>
<p><strong>Update</strong>: the data above is only valid before v0.8.0. As of v0.8.0, a new database structure (with associated filesystem layout) is used
for blocks and indexes.</p>
<hr />
<p>See also:</p>
<ul>
<li>Bitcoin.stackexchange.com
<ul>
<li><a href="https://bitcoin.stackexchange.com/q/51435/13866">Migration from Berkeley DB to LevelDB</a></li>
<li><a href="https://bitcoin.stackexchange.com/q/11104/13866">What is the database for?</a></li>
<li><a href="https://bitcoin.stackexchange.com/q/3173/13866">What information does a wallet contain?</a></li>
</ul>
</li>
<li>Stackoverflow.com
<ul>
<li><a href="https://stackoverflow.com/q/20442704/477035">How to open local bitcoin database</a></li>
</ul>
</li>
</ul>

CC BY-SA 4.0
2021-10-08T10:10:03.150Z
Added some links to questions with answers that may shed some additional light on the file formats or contents.
RedGrittyBrick
CC BY-SA 3.0
2012-03-15T15:49:13.940Z
I made a list of the various keys that exist in a wallet.dat file in http://bitcoin.stackexchange.com/a/3177/659 .  The list doesn't mention personal settings or a pointer to the current best block.  I think the personal settings are saved in ~/.config/Bitcoin/Bitcoin-Qt.conf nowadays.  But what about the pointer to the best block; is that still stored in the wallet?
Chris Moore
CC BY-SA 3.0
2012-03-16T08:42:09.750Z
Since 0.6.0rc2, settings are either stored in ~/.config/Bitcoin/Bitcoin-qt.conf (but very platform dependent) or bitcoin.conf, and no longer in wallet.dat.
Pieter Wuille
CC BY-SA 3.0
2012-03-16T16:15:17.180Z
I notice that an invalid setting is still stored in the wallet to prevent pre 0.4.0 clients which don't understand the 'minversion' entry from loading wallets that are too new for them to load properly.
Chris Moore
CC BY-SA 3.0
2012-03-16T16:54:54.340Z
Oh, yes, indeed.
Pieter Wuille
CC BY-SA 3.0
2012-07-20T20:34:23.483Z
Edited to reflect that there is now more than one blk000n.dat.
Stephen Gornick
CC BY-SA 3.0
2012-12-01T14:48:26.077Z
Edit: since 0.7.0, peers.dat is used instead of addr.dat.
Pieter Wuille
CC BY-SA 4.0
2011-09-10T16:28:08.757Z
2021-10-08T10:03:31.187Z
2021-10-08T10:03:31.187Z
Pieter Wuille
<p>What data do different Bitcoin .dat files contain? How about the other files in the same folder?</p>

<p>The wallet.dat file is somewhat documented and there are some ways to convert it to human-readable form, but I don't think the same can be said about the other files. What data do they store and how is it encoded?</p>

CC BY-SA 3.0
2012-12-01T21:39:58.827Z
These are tied to each Bitcoin.org client release.  For example, addr.dat was discontinued before v0.7.   Other big changes will occur with v0.8.
Stephen Gornick
<blockchain><wallet><development><database>
What do the different .dat files contain?
ThePiachu
# What do the different .dat files contain?

(Asked by: username_0 on 2011-09-10)

What data do different Bitcoin .dat files contain? How about the other files in the same folder?

The wallet.dat file is somewhat documented and there are some ways to convert it to human-readable form, but I don't think the same can be said about the other files. What data do they store and how is it encoded?

**Tags:** blockchain, wallet, development, database

> **Comments:**
> **username_1**: These are tied to each Bitcoin.org client release.  For example, addr.dat was discontinued before v0.7.   Other big changes will occur with v0.8.  

---

## 1 answers

### Answer by username_2 on 2011-09-10. Score: 42 | Accepted answer

`wallet.dat`, `addr.dat` and `blkindex.dat` are Berkeley Database files. They can be read using standard tools, but aren't human readable by themselves. `blk0001.dat` (and additional blk000n.dat blocks) contain the blockchain itself, that's just a binary concatenation of the blocks.

* `wallet.dat` contains your private keys, your address book, a copy of the transactions that send coins from or to one of your addresses, accounts, reserve keys, personal settings, and a pointer to the current best block.
* `addr.dat` contains IP addresses of peers, both those you've connected to yourself or those you've only heard about. It has been replaced by peers.dat since 0.7.0
* `peers.dat` contains the same information as addr.dat, but using an efficient custom format.
* `blkindex.dat` contains an index of the blocks and transactions that can be found in all the `blk000n.dat` files.

I don't know about any standalone tools that convert `addr.dat` and `blkindex.dat` to human-readable form, although [blockexplorer.com](http://blockexplorer.com) can be used to inspect the blockchain, and `addr.dat` just contains IP addresses.

**Update**: the data above is only valid before v0.8.0. As of v0.8.0, a new database structure (with associated filesystem layout) is used
for blocks and indexes.

---

See also:

* Bitcoin.stackexchange.com
  + [Migration from Berkeley DB to LevelDB](https://bitcoin.stackexchange.com/q/51435/13866)
  + [What is the database for?](https://bitcoin.stackexchange.com/q/11104/13866)
  + [What information does a wallet contain?](https://bitcoin.stackexchange.com/q/3173/13866)
* Stackoverflow.com
  + [How to open local bitcoin database](https://stackoverflow.com/q/20442704/477035)

> **Comments:**
> **username_4**: I made a list of the various keys that exist in a wallet.dat file in http://bitcoin.stackexchange.com/a/3177/659 .  The list doesn't mention personal settings or a pointer to the current best block.  I think the personal settings are saved in ~/.config/Bitcoin/Bitcoin-Qt.conf nowadays.  But what about the pointer to the best block; is that still stored in the wallet?  
> **username_2**: Since 0.6.0rc2, settings are either stored in ~/.config/Bitcoin/Bitcoin-qt.conf (but very platform dependent) or bitcoin.conf, and no longer in wallet.dat.  
> **username_4**: I notice that an invalid setting is still stored in the wallet to prevent pre 0.4.0 clients which don't understand the 'minversion' entry from loading wallets that are too new for them to load properly.  
> **username_2**: Oh, yes, indeed.  
> **username_1**: Edited to reflect that there is now more than one blk000n.dat.  
> **username_2**: Edit: since 0.7.0, peers.dat is used instead of addr.dat.  
> **username_3**: Added some links to questions with answers that may shed some additional light on the file formats or contents.  

---

