Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: Garrett Burgwardt on May 04, 2011, 06:09:01 AM



Title: Lost .00000001 of a bitcoin
Post by: Garrett Burgwardt on May 04, 2011, 06:09:01 AM
So after I installed the latest version right now, I wanted to test the fancy new send feature (sans message field!) and the full precision transactions. I sent a 32.28999999 transaction to myself and the software seems to have debited my address for the full 32.29 instead of just the amount I sent.

Did I stumble upon an actual bug or is Gavin going to swoop in here and explain how I'm missing something? :P


Title: Re: Lost .00000001 of a bitcoin
Post by: Garrett Burgwardt on May 04, 2011, 06:10:15 AM
Oh, my mistake - seems I paid a transaction fee of that amount - why though? I wasn't asked and I don't have a transaction fee set in the GUI - and this shouldn't run afoul of the new fee rules that I know about.


Title: Re: Lost .00000001 of a bitcoin
Post by: theymos on May 04, 2011, 06:19:10 AM
You were breaking a 32.29 BTC coin. The change was .00000001. In order to send a transaction with outputs less than 0.01, the network requires a fee of 0.01. This would obviously be pointless, so Bitcoin just threw the BTC away.


Title: Re: Lost .00000001 of a bitcoin
Post by: error on May 04, 2011, 06:24:12 AM
I think that'll be the first lost single satoshi. And I figured that was at least 50 years away!


Title: Re: Lost .00000001 of a bitcoin
Post by: walidzohair on May 04, 2011, 09:03:53 AM
I think that'll be the first lost single satoshi. And I figured that was at least 50 years away!

I lost about 20 BTC in my first days playing with miners and wallets :)


Title: Re: Lost .00000001 of a bitcoin
Post by: Garrett Burgwardt on May 04, 2011, 10:13:54 AM
Okay, new question then, as I've never heard as to why this is:

Why does change happen in this way? Couldn't the protocol simply allow you to only send so much of your balance from one address (say I have 10 btc at address 1X, and I send 5 of it to alice) and the rest just remains there?


Title: Re: Lost .00000001 of a bitcoin
Post by: theymos on May 04, 2011, 10:58:54 AM
Okay, new question then, as I've never heard as to why this is:

Why does change happen in this way? Couldn't the protocol simply allow you to only send so much of your balance from one address (say I have 10 btc at address 1X, and I send 5 of it to alice) and the rest just remains there?

You can only spend entire coins. Otherwise, the system would have to track balances for inputs (or addresses), which would add a lot of complexity and probably break some things.


Title: Re: Lost .00000001 of a bitcoin
Post by: pc on May 04, 2011, 11:54:34 AM
Does it check to see if it could add another input in order to avoid throwing money away in a fee, or does it just look for the first input that fits, and it's just too bad if it's less than 0.01 more than the amount of the transaction?


Title: Re: Lost .00000001 of a bitcoin
Post by: Gavin Andresen on May 04, 2011, 12:41:36 PM
Does it check to see if it could add another input in order to avoid throwing money away in a fee, or does it just look for the first input that fits, and it's just too bad if it's less than 0.01 more than the amount of the transaction?

The latest version of bitcoin does try to avoid "sub-cent change" by adding more inputs.

If it can't avoid it (e.g. you have 32.29 in your wallet and you send 32.28999999), then the sub-cent change becomes a sub-cent transaction fee.  It isn't lost, the miner that includes the transaction will get it.