Bitcoin Forum
December 06, 2016, 06:15:22 PM *
News: Latest stable version of Bitcoin Core: 0.13.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: What data exactly is stored in a wallet.dat file?  (Read 3187 times)
gigabytecoin
Sr. Member
****
Offline Offline

Activity: 280


View Profile
June 16, 2011, 06:22:13 AM
 #1

And why is it not necessary to backup any of the other files in your bitcoin folder in order to re-create your wallet?

Also: will the "format" of a wallet ever change? Will it ever need to? Even in 50+ years?
1481048122
Hero Member
*
Offline Offline

Posts: 1481048122

View Profile Personal Message (Offline)

Ignore
1481048122
Reply with quote  #2

1481048122
Report to moderator
1481048122
Hero Member
*
Offline Offline

Posts: 1481048122

View Profile Personal Message (Offline)

Ignore
1481048122
Reply with quote  #2

1481048122
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
imperi
Full Member
***
Offline Offline

Activity: 196


View Profile
June 16, 2011, 06:30:44 AM
 #2

And why is it not necessary to backup any of the other files in your bitcoin folder in order to re-create your wallet?

Also: will the "format" of a wallet ever change? Will it ever need to? Even in 50+ years?

The wallet contains the public/private key pairs. The public keys are your addresses. These key pairs are matched with the blocks the client downloads from the network, I believe, to see how much money you have.

The format could change if everyone "agrees" on a new one and all the clients are modified. It might need to because SHA-2 could be broken, or other maybe there are other protocol deficiencies we don't know about yet.
gigabytecoin
Sr. Member
****
Offline Offline

Activity: 280


View Profile
June 16, 2011, 07:04:10 AM
 #3

Thanks for that.

O.K. so I just loaded up my "backed up" wallet to a new ubuntu install and began downloading the blockchain.

How does my bitcoin client "know" that I have a balance on that wallet but that it is still "unconfirmed"? Doesn't it need to download the block chain to know that first? Or is individual transaction information associated with each address encoded in the wallet.dat file each time a transaction is made?
NetTecture
Full Member
***
Offline Offline

Activity: 140


View Profile
June 16, 2011, 07:17:41 AM
 #4

Thanks for that.

O.K. so I just loaded up my "backed up" wallet to a new ubuntu install and began downloading the blockchain.

How does my bitcoin client "know" that I have a balance on that wallet but that it is still "unconfirmed"? Doesn't it need to download the block chain to know that first? Or is individual transaction information associated with each address encoded in the wallet.dat file each time a transaction is made?

You dont ahve any balance on the wallet. You have addresses. What the addresses contain is visible for everyonne in the blockchain.
Stephen Gornick
Legendary
*
Offline Offline

Activity: 1988



View Profile
June 16, 2011, 07:18:19 AM
 #5

Quote
What data exactly is stored in a wallet.dat file? )
 - http://en.bitcoin.it/wiki/Wallet

Also: will the "format" of a wallet ever change? Will it ever need to? Even in 50+ years?

We can't know what will happen in the future but we know that software changes and improves.  There will likely always be a way to import either the binary wallet data file itself or to export wallet data and import that data into the new system.

Related:
  - http://forum.bitcoin.org/?topic=2348.0

mmortal03
Legendary
*
Offline Offline

Activity: 1395


View Profile
June 16, 2011, 07:26:58 AM
 #6

How does one read the wallet.dat in plain text?  Say I wanted to print out the keys and recreate it later in digital form, is that possible?
gigabytecoin
Sr. Member
****
Offline Offline

Activity: 280


View Profile
June 16, 2011, 08:24:45 AM
 #7

How does one read the wallet.dat in plain text?  Say I wanted to print out the keys and recreate it later in digital form, is that possible?

It is possible to do. You have to encode the wallet.dat file to some kind of alpha-numeric format first however instead of binary code I believe.
willphase
Hero Member
*****
Offline Offline

Activity: 770


View Profile
June 16, 2011, 08:30:09 AM
 #8

get db_dump from e.g. here (or Google it)

then you can dump your database as hex strings, but you'll want to massage the data a bit to make it anything meaningful.  Be very careful when playing with your wallet.dat as it contains all your keys and you will lose all your BTC sent to those keys if you corrupt your wallet (always take backups!)

Will

titeuf_87
Member
**
Offline Offline

Activity: 112


View Profile
June 16, 2011, 09:32:25 AM
 #9

The bitcointools made by Gavin has an utility to parse your wallet.dat and parse the data stored in there.

15kfBM3TQ4PGzL7cKncU3su2pH7ZJmiLtr
jerfelix
Sr. Member
****
Offline Offline

Activity: 266


View Profile
June 16, 2011, 11:50:29 AM
 #10

https://en.bitcoin.it/wiki/Wallet

A Bitcoin wallet contains[1]:

    your keypairs for each addresses
    transactions done from/to your addresses
    user preferences
    default key
    reserve keys
    accounts
    a version number
    Key pool
    Since 0.3.21: information about the current best chain, to be able to rescan automatically when restoring from a backup.


So a Wallet file contains all your transaction history (which is also stored in the Block Chain).  Of course, the Block Chain's version is the "official" version of the transaction history (so people can't modify their wallet to suddenly have more money).

It's possible to run bitcoin with the -rescan option to recreate your transaction history (a great way to recover lost coins), but this will only work based on what keypairs you have in your wallet.  So if you execute 200 transactions and then restore an old wallet, and then -rescan, you could be missing a lot of Bitcoins.
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!