Bitcoin Forum

Bitcoin => Bitcoin Discussion => Topic started by: barbarousrelic on June 07, 2011, 03:46:34 PM



Title: How is it possible that a wallet backed up before a transaction occurs. . .
Post by: barbarousrelic on June 07, 2011, 03:46:34 PM
can still restore coins received in that transaction?

Say I back up my wallet today, and tomorrow I get sent 100 coins. Then, my computer crashes. From what I've read it sounds like I will still have those 100 coins when I restore my backup. How is that possible? And if it's possible, why is it necessary to ever back up more than once?

edit: found it. I should read more. : https://en.bitcoin.it/wiki/Backup#Technical_Background

So does this mean that if you always receive at the same address, you never technically need to back up more than once?


Title: Re: How is it possible that a wallet backed up before a transaction occurs. . .
Post by: Threshold on June 07, 2011, 03:50:05 PM
So far I have received bitcoins from two sources.  Each source paid a different address I own some money.

If I backed things up today, tomorrow added a third address that you sent money to, had a computer crash, restored my backup, then I believe I'd only have the cash from my first two addresses -- as there'd be no record of my owning that third address that you sent money to...

So you owe me some cash, barb!  :)


Title: Re: How is it possible that a wallet backed up before a transaction occurs. . .
Post by: Garrett Burgwardt on June 07, 2011, 03:51:07 PM
By default, the wallet creates 100 keys as a buffer (not sure if it's a rolling buffer, you'd have to ask Gavin or someone).

So you have 100 different addresses to pick from with a fresh wallet backup before you need to backup again.

So yes, use only one address and you'll never need to backup again.


Title: Re: How is it possible that a wallet backed up before a transaction occurs. . .
Post by: BubbleBoy on June 07, 2011, 03:51:45 PM
The only important content of your wallet are the private keys with which you can spend your coins. The fact that you own them is stored in the blockchain for everyone to see. So when the client reconnects to the network it resyncs with the current blockchain and finds out about the money receive, just as if you hadn't turned on your computer during the last two days.


Title: Re: How is it possible that a wallet backed up before a transaction occurs. . .
Post by: barbarousrelic on June 07, 2011, 03:57:33 PM
I try to always receive with the same Bitcoin address, but for some reason it seems that Bitcoin changes the address listed under "Your Bitcoin Address:" without my requesting it to change. Is there an action I may be doing that causes it to change on its own?


Title: Re: How is it possible that a wallet backed up before a transaction occurs. . .
Post by: 2_Thumbs_Up on June 07, 2011, 04:03:21 PM
That is expected behavior. It is recommended to use a new recieving adress for every transaction for better privacy. The standard client does this automatically for you. I don't know it there is a way to turn it off though.


Title: Re: How is it possible that a wallet backed up before a transaction occurs. . .
Post by: Dude65535 on June 07, 2011, 04:27:01 PM
By default, the wallet creates 100 keys as a buffer (not sure if it's a rolling buffer, you'd have to ask Gavin or someone).

So you have 100 different addresses to pick from with a fresh wallet backup before you need to backup again.

So yes, use only one address and you'll never need to backup again.

One thing to note is that the 100 buffer keys do not start getting generated until you create your second address. Even then it takes awhile for all of them to be generated.

0.3.22 might have changed that but someone got burned by expecting the 100 extra addresses and finding out they did not have them in the wallet backup they made.


Title: Re: How is it possible that a wallet backed up before a transaction occurs. . .
Post by: Maged on June 07, 2011, 07:03:46 PM
By default, the wallet creates 100 keys as a buffer (not sure if it's a rolling buffer, you'd have to ask Gavin or someone).
Currently it's rolling, but a pull request is in that would change it to (by default) top you off to 100 addresses only when you go below 75 unused addresses. We'll see if that goes anywhere.

So you have 100 different addresses to pick from with a fresh wallet backup before you need to backup again.
Be sure to see Dude65535's note above.

So yes, use only one address and you'll never need to backup again.
Not entirely true. (Almost) every time you send bitcoins, a new address from the pool is used to return your "change". As such, the easiest way right now to be safe is to just back up every 100 transactions.