Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: SgtSpike on July 15, 2011, 07:53:59 AM



Title: Lots of 0.01's... change, or not?
Post by: SgtSpike on July 15, 2011, 07:53:59 AM
Just looking at block 136199, and am a bit confused.

Take this transaction, for example:
Code:
1JdZBMPngojXLLCF9iAdxLBohnoXAYtXKT: 191.95
1JMGETciPWYj5i9uoaMcr2BxjMTo8s5YSH: 1.46

1G8ha6G49DMU6nezu2xbZTawuHNUhb3Qh8: 0.01
1JmsGtjUzsrggt4hG87p46qDxv4ehHPUPV: 193.4
Now, I would assume that 0.01 was the bitcoins sent, and 193.4 was the change, but why would it bring in two addresses if that is the case?

If 193.4 was the amount sent, why would someone keep 0.01 as change?  Why would so many someones keep 0.01 as change?  I count at least four instances of 0.01 being left over (or sent), but the source was two addresses with amounts larger than 0.01.  I consider it unlikely that the 193.4 and the 162.12 were just 0.01 off from being the amounts that the persons wanted to send.  I consider it much more likely that 0.01 was the amount being sent, and 193.4 and 162.12 was the change left over.  But if that's the case, why are multiple addresses being pulled in to the transaction if one address was sufficient to perform the transaction?

 ???


Title: Re: Lots of 0.01's... change, or not?
Post by: SgtSpike on July 15, 2011, 08:01:03 AM
I'm ignorant to this stuff but I thought the fee was separate?
Fee is separate, but it is not shown as part of the transactions.  The fees are all gathered up into the block reward address.


Title: Re: Lots of 0.01's... change, or not?
Post by: spruce on July 15, 2011, 08:04:40 AM
Isn't it always the case that if there are two addresses shown in the right-hand column then the lower one is the transaction and the upper one is the change?

One way to possibly disprove this is to examine your own transactions in block explorer and see if it holds true or not.


Title: Re: Lots of 0.01's... change, or not?
Post by: SgtSpike on July 15, 2011, 08:06:45 AM
Isn't it the case that if there are two addresses shown in the right-hand column then the lower one is the transaction and the upper one is the change. Always?
No.  The only entity that knows the change address is the bitcoin client of the user creating the transaction.  To everyone else, it's just BTC sent to two different addresses.


Title: Re: Lots of 0.01's... change, or not?
Post by: error on July 15, 2011, 08:21:57 AM
If I were to go by the coin selection algorithm, I'd say the 0.01 is the change on this transaction. Of course, there is an unofficial patch out there which lets users select specific coins to spend, and if someone's using that, there's no way to know for sure.


Title: Re: Lots of 0.01's... change, or not?
Post by: Maged on July 15, 2011, 08:25:27 AM
If a wallet has a lot of coins to select from, such as an ewallet, there will very likely be a very small amount used for change. It wouldn't surprise me if it turned out that MtGox sent this specific transaction.


Title: Re: Lots of 0.01's... change, or not?
Post by: spruce on July 15, 2011, 09:02:08 AM
I've made some .01 errors when starting out. If I wanted to send 1.5 BTC, I would send 1.51 BTC thinking I needed to include the .01 BTC fee in the amount being sent. It was only after a few transactions that I realised the fee comes out of the general wallet balance and not as a deduction from what I was sending.


Title: Re: Lots of 0.01's... change, or not?
Post by: SgtSpike on July 15, 2011, 04:23:05 PM
If I were to go by the coin selection algorithm, I'd say the 0.01 is the change on this transaction. Of course, there is an unofficial patch out there which lets users select specific coins to spend, and if someone's using that, there's no way to know for sure.
Where can I view the coin selection algorithm?  It just seems odd that someone would send 193.4 and not the full 193.41.  And 162.12 instead of the full 162.13...

Is it possible that the client is misreporting the wallet balance, so when someone wants to transfer all of their coins to a new address, they send all of the coins they *think* they have?

I've made some .01 errors when starting out. If I wanted to send 1.5 BTC, I would send 1.51 BTC thinking I needed to include the .01 BTC fee in the amount being sent. It was only after a few transactions that I realised the fee comes out of the general wallet balance and not as a deduction from what I was sending.
But that's not what is happening here...  The 0.01 and the 1.5 are separate, not combined and sent to the same address.


Title: Re: Lots of 0.01's... change, or not?
Post by: error on July 15, 2011, 06:55:29 PM
Where can I view the coin selection algorithm?

You can find CWallet::SelectCoins() in wallet.cpp.