<p>A default bitcoin wallet contains a list of private and pub key pairs. A number of keys are created on generation this is to allow for "swap" as you send money from it, these are not visible directly. This does not affect your balance which you use.</p>

<p>Your transactions are stored within the blockchain. If you generate new address to receive to then your wallet size will grow. If your wallet is moved to a new computer, with no blockchain, it will appear empty until you download blocks up until your transactions are known by the client.</p>

CC BY-SA 3.0
2012-03-15T15:23:26.237Z
Yes, but the wallet also contains a copy of the transactions that affect your balance.  If you restore an old backup of wallet.dat you'll find it is missing transactions that happened after the backup until you use the -rescan command line option to get it to look through the blockchain and copy the relevant new transactions into the wallet.dat.
Chris Moore
CC BY-SA 3.0
2012-03-15T15:24:48.090Z
Not all clients store this information as far as im aware.
MaxSan
CC BY-SA 3.0
2012-03-15T17:30:16.927Z
I guess I assumed the question was about the Satoshi client.  Is there another one which keeps its wallet in "wallet.dat" and rescans the entire blockchain every time you run it?
Chris Moore
CC BY-SA 3.0
2012-03-15T19:01:13.007Z
Your correct. I took wallet as generic rather than the specific client. Il modify my answer.
MaxSan
CC BY-SA 3.0
2012-03-15T15:09:41.540Z
2012-03-15T15:09:41.540Z
MaxSan
<p>From looking at the code, the wallet.dat can contain entries of the following types:</p>

<ul>
<li><code>name</code> - an address book name</li>
<li><code>tx</code> - a transaction</li>
<li><code>acentry</code> - an accounting entry</li>
<li><code>key</code> - a pair of public and private keys</li>
<li><code>mkey</code> - a master key</li>
<li><code>ckey</code> - an encrypted key</li>
<li><code>defaultkey</code> - the default receiving address' key</li>
<li><code>pool</code> - a keypool entry</li>
<li><code>version</code> - the version of the software that wrote this wallet</li>
<li><code>minversion</code> - the earliest version of the software that can read this wallet</li>
<li><code>cscript</code> - a script</li>
<li><code>bestblock</code> - a pointer to the end of the best blockchain seen</li>
<li><code>wkey</code> - a private key (no longer used)</li>
<li><code>setting</code> - used to store user interface settings (no longer used, except to hold an invalid setting to stop pre-0.4.0 versions of the client which don't understand <code>minversion</code> from loading wallets that are too new for them)</li>
</ul>

<p>See also <a href="https://bitcoin.stackexchange.com/a/854/659">this answer</a>.</p>

CC BY-SA 3.0
2012-03-15T18:15:38.877Z
wkey is not used anymore, afaik, it is a private key with some metadata. key contains both public and private key. There is also 'bestblock' with a locator of the last seen tip of the blockchain.
Pieter Wuille
CC BY-SA 3.0
2012-03-15T15:21:36.567Z
2012-03-16T16:41:30.770Z
2017-04-13T12:47:36.647Z
Chris Moore
<p>What information does the Bitcoin wallet file used by the Bitcoin.org client contain? </p>

<p>Is the owner's Bitcoin balance written in the <code>wallet.dat</code> file, or does it contain a list of transactions that have been made since the beginning of wallet creation?  Does the wallet's filesize grow bigger as more transactions are made?</p>

CC BY-SA 3.0
2012-03-15T19:38:40.913Z
Now that there are clients with their own wallet formats, I clarified the question by specifying that it is referring to the Bitcoin.org client.
Stephen Gornick
<wallet>
What information does a wallet contain?
uray
# What information does a wallet contain?

(Asked by: username_0 on 2012-03-15)

What information does the Bitcoin wallet file used by the Bitcoin.org client contain?

Is the owner's Bitcoin balance written in the `wallet.dat` file, or does it contain a list of transactions that have been made since the beginning of wallet creation? Does the wallet's filesize grow bigger as more transactions are made?

**Tags:** wallet

> **Comments:**
> **username_1**: Now that there are clients with their own wallet formats, I clarified the question by specifying that it is referring to the Bitcoin.org client.  

---

## 2 answers

### Answer by username_3 on 2012-03-15. Score: 14 | Accepted answer

From looking at the code, the wallet.dat can contain entries of the following types:

* `name` - an address book name
* `tx` - a transaction
* `acentry` - an accounting entry
* `key` - a pair of public and private keys
* `mkey` - a master key
* `ckey` - an encrypted key
* `defaultkey` - the default receiving address' key
* `pool` - a keypool entry
* `version` - the version of the software that wrote this wallet
* `minversion` - the earliest version of the software that can read this wallet
* `cscript` - a script
* `bestblock` - a pointer to the end of the best blockchain seen
* `wkey` - a private key (no longer used)
* `setting` - used to store user interface settings (no longer used, except to hold an invalid setting to stop pre-0.4.0 versions of the client which don't understand `minversion` from loading wallets that are too new for them)

See also [this answer](https://bitcoin.stackexchange.com/a/854/659).

> **Comments:**
> **username_4**: wkey is not used anymore, afaik, it is a private key with some metadata. key contains both public and private key. There is also 'bestblock' with a locator of the last seen tip of the blockchain.  

---

### Answer by username_2 on 2012-03-15. Score: 2

A default bitcoin wallet contains a list of private and pub key pairs. A number of keys are created on generation this is to allow for "swap" as you send money from it, these are not visible directly. This does not affect your balance which you use.

Your transactions are stored within the blockchain. If you generate new address to receive to then your wallet size will grow. If your wallet is moved to a new computer, with no blockchain, it will appear empty until you download blocks up until your transactions are known by the client.

> **Comments:**
> **username_3**: Yes, but the wallet also contains a copy of the transactions that affect your balance.  If you restore an old backup of wallet.dat you'll find it is missing transactions that happened after the backup until you use the -rescan command line option to get it to look through the blockchain and copy the relevant new transactions into the wallet.dat.  
> **username_2**: Not all clients store this information as far as im aware.  
> **username_3**: I guess I assumed the question was about the Satoshi client.  Is there another one which keeps its wallet in "wallet.dat" and rescans the entire blockchain every time you run it?  
> **username_2**: Your correct. I took wallet as generic rather than the specific client. Il modify my answer.  

---

