Author

Topic: What happens when you load an old .dat? (Read 1107 times)

sr. member
Activity: 266
Merit: 250
I want free lunch, i'm gonna go with this guy.
August 01, 2012, 12:29:27 PM
#13
pretty obvious
legendary
Activity: 1288
Merit: 1227
Away on an extended break
if i download a new client version, does it overwrite the old .dat file or just use the existing?
Not too sure about that, but it's a good practice that you backup your wallet.dat file religiously, and keep it encrypted. If a new wallet.dat file is installed, just overwrite it with your existing one.
full member
Activity: 188
Merit: 100
if i download a new client version, does it overwrite the old .dat file or just use the existing?
sr. member
Activity: 266
Merit: 250
I want free lunch, i'm gonna go with this guy.
good info, thanks guys
legendary
Activity: 1820
Merit: 1000
July 30, 2012, 10:56:47 PM
#9
Whatever happens, I'm pretty sure it's better than when you date and old load.
newbie
Activity: 10
Merit: 0
July 30, 2012, 09:59:42 PM
#8
good question i was wonder same thing
legendary
Activity: 922
Merit: 1003
July 30, 2012, 06:48:32 PM
#7
Ok got it, so all bitcoins are stored on the network, the .dat stores your keys to the associated bitcoins. If I load an old .dat with keys to bitcoins ive spent those keys are now useless and so it will automativccaly readjust the client wallet balance?

I assume it deletes the useless keys also?
Keys are not associated with bitcoins directly; they are associated with your receiving addresses. The Client uses those keys to determine which addresses in the blockchain (and thus which transactions) belong to your wallet.dat. You can have numerous transactions going to (or coming from) the same address. Whether you have sent, or received, however many bitcoins in the past does not affect those keys. You will always have them.
legendary
Activity: 1148
Merit: 1008
If you want to walk on water, get out of the boat
July 30, 2012, 05:52:49 PM
#6
useless keys? spent keys?

no key is "useless" and it will never automatically delete a key! An empty key can still be used as a receiving address, so if you delete it and someone you previously gave that address send you bitcoins to that address, bad bad thing, you don't have the key to use them...

If you have a chest and empty it, you don't trash it, or trash its key  Cheesy it can still be useful...
newbie
Activity: 43
Merit: 0
July 30, 2012, 05:47:22 PM
#5
Ok got it, so all bitcoins are stored on the network, the .dat stores your keys to the associated bitcoins. If I load an old .dat with keys to bitcoins ive spent those keys are now useless and so it will automativccaly readjust the client wallet balance?

I assume it deletes the useless keys also?
legendary
Activity: 922
Merit: 1003
July 30, 2012, 04:27:14 PM
#4
What happens when you load an old wallet.dat into a new client where some bitcoins still exist but some dont, does the network simply work out the new balance and correct the .dat?
Short answer: yes. However, there is nothing to 'correct'.

The wallet.dat file does not record your coin balance; it contains (secret) keys associated with your public bitcoin addresses. The transaction history of all bitcoins (and, by extension, your current balance) is kept in the public blockchain, separate from your wallet.dat file.

Simply, the bitcoin client scans the blockchain and finds transactions associated with the keys in your wallet.dat. It then 'knows' your current balance and transaction history.

Loading an old wallet.dat into a new client will not affect any of this, since both new and old wallet.dat files contain the same keys. Thus the client will come to the same result when it scans the blockchain.

One caveat is that if you had generated many (100+) new addresses in your new wallet.dat, some of those new addresses may not exist in your old wallet.dat file. Thus if you were to load the old one, transactions associated with the new addresses would not be counted properly. My details may be off, but it works something like this: a 'fresh' wallet.dat contains keys for 100 or so addresses. After you exhaust those, another block of 100 keys/addresses is automatically generated. If this is triggered, the new wallet.dat file will contain the new addresses, but your old one won't.

Thus it is good practice to regularly backup your wallet.dat file to ensure you always have all your addresses.
legendary
Activity: 1148
Merit: 1008
If you want to walk on water, get out of the boat
July 30, 2012, 04:14:40 PM
#3
Wallet.dat just contain your private keys, then the client check the blockchain and check how many bitcoins do these keys have.

(yes it contains more info than that, but what matter are the private keys, the rest are useful things to speed up things if i'm right)
sr. member
Activity: 336
Merit: 254
CEO of Privex Inc. (www.privex.io)
July 30, 2012, 04:10:38 PM
#2
Where some bitcoins exist, but some don't?
I'm confused, do you mean you've spent bitcoins from a newer wallet, and you're wishing to restore a wallet from before you've spent them?
Generally, with the latest bitcoin, it will automatically re-scan the blockchain in order to correct the balance displayed. If not, you can append the "-rescan" switch to your Bitcoin shortcut.
newbie
Activity: 43
Merit: 0
July 30, 2012, 03:37:35 PM
#1
What happens when you load an old wallet.dat into a new client where some bitcoins still exist but some dont, does the network simply work out the new balance and correct the .dat?
Jump to: