Author

Topic: BTC protocol question - why do I get money back? (Read 1724 times)

hero member
Activity: 496
Merit: 500
It would seem your (obviously lacking in error control) backup script made you develop a cavalier attitude toward the wallet file.
Ever heard of doing off-site backups?

It's not a backup script.

Also, what the hell? Unless you changed it, there should be a pool of 100 unused keys in your wallet.
How were you able to run out of key-pool with so many "recent backups"?
Something just doesn't add up here.

As I mentioned, this occurred after the release of 0.5.0. The first time that version runs it rewrites your wallet, which entails creating a new key pool. If I had realized this at the time, I would not have deleted wallet.dat and would not have had this problem. Since I didn't, though, I deleted it and lost the completely new pool, from which the ~77 BTC change address pulled.
full member
Activity: 210
Merit: 100
I lost 77 BTC that day and it has made me much more cautious.
It would seem your (obviously lacking in error control) backup script made you develop a cavalier attitude toward the wallet file.
Ever heard of doing off-site backups?

Also, what the hell? Unless you changed it, there should be a pool of 100 unused keys in your wallet.
How were you able to run out of key-pool with so many "recent backups"?
Something just doesn't add up here.
hero member
Activity: 496
Merit: 500
People have already lost coins, but since the implementation of the key-pool I haven't heard of any unsolved problems.

I lost some partially due to my own stupidity, partially due to not realizing that this change occurred.

Quote
Technical note: the encrypted wallet’s ‘keypool’ will be regenerated the first time you request a new bitcoin address;

I keep multiple wallets, encrypted with GPG. I have a script that lets me choose a wallet, unpacks it to the ~/.bitcoin directory, waits for Bitcoin to close, and then encrypts and securely deletes the wallet. For this reason, if something goes wrong, I feel comfortable deleting the wallet.dat file since I have a very recent (encrypted) backup.

So, I updated to the new version, it futzed around with my wallet, I sent some coins to myself (change going to an address from the (fresh) key pool). Then I closed Bitcoin and something went wrong with my script, so I deleted wallet.dat, along with the private key used for the change. I lost 77 BTC that day and it has made me much more cautious.
hero member
Activity: 533
Merit: 500
^Bitcoin Library of Congress.
I am still undecided if I like that "send change somewhere else" (because its more anonymous) or hate it (because eventually someone will lose Bitcoins)..

Ente
People have already lost coins, but since the implementation of the key-pool I haven't heard of any unsolved problems.
donator
Activity: 853
Merit: 1000
I am still undecided if I like that "send change somewhere else" (because its more anonymous) or hate it (because eventually someone will lose Bitcoins)..

Ente

True, this why you have to be so careful when spending bitcoin! Because it is not immediately obvious in the default client what is going on. The coderr patch makes it much more transparent.
legendary
Activity: 2126
Merit: 1001
I am still undecided if I like that "send change somewhere else" (because its more anonymous) or hate it (because eventually someone will lose Bitcoins)..

Ente
donator
Activity: 853
Merit: 1000
Ahhhhh, right.

Okay, I feel stupid now Smiley

Thanks though!
hero member
Activity: 742
Merit: 500
I think I'm just not understanding something about the BTC protocol. Can someone explain why Bitcoin splits my transaction into seemingly random-sized smaller transactions, and why it automatically creates a new second address during a transaction ( that is, it sends some coins back to me at a new address)?

I thought you could just cleanly sign over a specific number of coins to a new address.

Thanks!


When the output of a transaction is used as the input of another transaction, it must be spent in its entirety. Sometimes the coin value of the output is higher than what the user wishes to pay. In this case, the client generates a new Bitcoin address, and sends the difference back to this address. This is known as change.
The wallet file contains the private keys for change addresses, and they can receive and send coins normally. However, the GUI in the default client does not display them in the address book.
hero member
Activity: 728
Merit: 500
165YUuQUWhBz3d27iXKxRiazQnjEtJNG9g
It can't just use the balance of an address.  It has to name specific inputs.  So if you received .01 BTC 50 times, and you want to spend .25 BTC, it will have to specifically call out 25 of those transactions as inputs, then one or two outputs (depending if change is required).
donator
Activity: 853
Merit: 1000
I think I'm just not understanding something about the BTC protocol. Can someone explain why Bitcoin splits my transaction into seemingly random-sized smaller transactions, and why it automatically creates a new second address during a transaction ( that is, it sends some coins back to me at a new address)?

I thought you could just cleanly sign over a specific number of coins to a new address.

Thanks!
Jump to: