Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: jackjack on July 02, 2013, 08:20:24 AM



Title: [EXPLANATION] Unknown output - Missing money - Change
Post by: jackjack on July 02, 2013, 08:20:24 AM

I tried to make something that would be worth stickying so that people stop wondering about change
Please report any typo/unclear thing/precisions to add/etc



First, you need to know that in Bitcoin you can't use only a part of an incoming transaction.

When you create a transaction with a client, there's little probability that you have inputs whose sum is equal to the sum of outputs.
In those cases, your client needs to gather more funds than necessary, then send you back the remaining money.
That remaining money is sent to a newly created 'hidden' address in your wallet.

Example
I sent 2.13 BTC to 18r2UXXWHHUXfjAdAfvpinNfBhLSpXyDq7
I did't have any incoming transactions that is exactly 2.13 BTC though.
So my client:
  • used 3 different incoming transactions (inputs) to have a balance>2.13 BTC
  • then sent the 2.13 BTC to my friend
  • finally sent me back (using a new address, 1NmzZ...) the remaining money

The transaction on blockchain.info (http://blockchain.info/fr/tx/3bc0797fd88dadec4fb0de34ff66d313ccc9ff1f3e64a16e5a35633115200237)
Inputs: 2.23112154 BTC
Quote
1BHZhpjnCxUj7YZ5p7vZx7tYgYZ2Bvyb8V (0.378 BTC)
161Y2giMmSNhHQAXEqCiVr8np3baJSSTkt (1.68874132 BTC)
18aypyA5EtqMPYqkv1gk7XVHbqJtgk6Q6o (0.16438022 BTC)

Outputs: 2.23062154 BTC (fee: 0.0005 BTC)
Quote
1NmzZpXDVASPXBRfh2kXNCWwFEtacLmAGU - 0.10062154 BTC
18r2UXXWHHUXfjAdAfvpinNfBhLSpXyDq7 - 2.13 BTC


See also:
Change article on bitcoin.it (https://en.bitcoin.it/wiki/Change)


Title: Re: [EXPLANATION] Unknown output - Missing money - Change
Post by: Remember remember the 5th of November on July 03, 2013, 10:06:39 AM
Great article!