Search notes:

Wallet [Bitcoin]

The wallet does not actually contain coins. Rather, it stores the keys that allow you to spend the coins that are associated with a specific Bitcoin address.
The actual value of coins in a wallet is determined by traversing the entire blockchain and summing up all credit/debit transactions values for the addresses stored in the wallet.
The wallet is not only a collection of keys. It also contains transactions, accounting information, settings and information about the blockchain.

Reading/writing wallet.dat

Bitcoin core uses Berkeley DB (BDB) to read/write wallet files (wallet.dat).
Apparently, the entries in the wallet have one of the following types (cf src/wallet/walletdb.cpp, function ReadKeyValue):
See also the function ReadKeyValue() in src/wallet/walletdb.cpp.

Links

Personalize your wallet with a vanity address
Bitcoin core: wallet related classes

See also

Bitcoin

Index