2

I just noticed that when you send an amount to someone. You actually send them the entire wallet amount and then it gets sent back as change. Is this true and why was it implemented in this way?

Also since it gets sent back as change, how would this affect a paper wallet? Does the same apply? Currently I have a paper wallet and I sent some coins to another wallet from my paper one. I hope everything is still safe.

3

Requiring an output to be fully consumed by a single transaction simplifies things -- an output is either spent or unspent, period. The idea is to avoid a proliferation of partially unspent outputs that would be very difficult to track. If a transaction could partially consume an output, then you'd have a whole new category of partially unspent outputs, each potentially partially consumed in some number of places.

It is possible to send the "change" to the original receiving address. If you do that, the paper wallet will still contain the key to access the new change outputs. If you use a new address for the change, then the paper wallet will be unable to spend the change. (Unless it's a complex type of deterministic wallet, which I very much doubt.)

With the current system, each output is either consumed by a transaction which has it as an input or it is unconsumed and is a valid output to be consumed by a future transaction. With partial spends allowed, each output could be partially-consumed by any number of other transactions, making the system much more complex.

Current System:

  1. You get a check for $100. You now have a $100 unspent output.

  2. You send $10 to a friend by consuming the $100 and sending $90 to yourself. The $100 check is now fully consumed. You have one output for $90 and nobody cares about the check anymore.

  3. You send $20 to a friend by consuming the $90 and sending $70 to yourself. You now still have only one output, both previous outputs are fully consumed.

Notice how the state stays simple at all times? Every output is either fully-consumed or untouched.

System with partial consumption:

  1. You get a check for $100. You have a $100 unspent output.

  2. You send $10 to a friend. To understand that you have $90 left, we need to look at both the $100 check you got and the $10 you sent to a friend.

  3. You send $20 to a friend. To understand that you have $70 left, we need to look at the $100 check you got, the $10 you sent in step 2, and the $20 you sent now.

Notice how the system's state is getting much more complicated? To understand what is left of the $100, we have to look at two other transactions that partially consumed it.

It's just much simpler to fully consume and replace with a new, smaller unspent output than have to track partial consumption across two places.

Worse, imagine if you got two checks for $10 and wanted to send $15 to a friend. Now we'd have to look in three places to know what was left -- both checks and the $15 you sent to a friend to figure out you have $5 left. It's much, much simpler to just destroy the original checks and issue you a $5 payment to yourself. Now, we know the checks are dead because a transaction touches them. We know the $5 payment to yourself is good because nothing touches it. Everything is either spent or unspent. Simple.

  • i dont understand what you mean by: If a transaction could partially consume an output, then you'd have a whole new category of partially unspent outputs, each potentially partially consumed in some number of places. – Patoshi パトシ Dec 27 '13 at 7:39
  • Say I send you 1 Bitcoin. Right now, that output could be either spent or unspent, but that's it. So it either has a consuming transaction or it does not. If you could partially consume it, then one transaction could spend 0.1 of it and another 0.2 of it -- to understand its state you could need to look at an unbounded number of other transactions. That's much more complex. – David Schwartz Dec 27 '13 at 7:48
  • So in what scenario where change would lost? Also if I get it right when you send a transaciton, it sends the entire wallet contents to the person and embedded in the transaction data it states how much to send back? I'm just really curious to why it was done like this and why not just send partial amounts. – Patoshi パトシ Dec 27 '13 at 16:54
  • @duckx It gathers as many inputs as necessary into a pile and then produces as many outputs as necessary from that pile. It was done that way because otherwise each output could be partially consumed by arbitrarily many transactions, rather than just being fully-consumed by one. – David Schwartz Dec 27 '13 at 18:23
  • 1
    @duckx it never sends the whole wallet to the other party. The word 'change' is very misleading here, like many words in the bitcoin arena. 'Wallet' is not exactly like the wallet in your pocket either. 'Address' is not really like an email address. Let go of the exact definitions of those words first. Only after you understand the bitcoin working you will see that 'change', 'wallet' and 'address' are actually very good descriptions. So: 1 transaction always fully uses 1 or more previous transactions as inputs and has 1 or more outputs, one of them often happens to be your own address – Jannes Jan 1 '14 at 5:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.