mirror of
https://github.com/bitcoinbook/bitcoinbook
synced 2025-02-04 11:53:09 +00:00
CH02::Change update for illustration, add detail
- Update text to refer to new illustration - Introduce the term "change output" in addition to existing term "change address" - Add information about the privacy advantages of unique change addresses
This commit is contained in:
parent
b05a5ee6f8
commit
a4327fa4fe
@ -253,22 +253,33 @@ that's what the protocol itself uses.
|
|||||||
==== Making Change
|
==== Making Change
|
||||||
|
|
||||||
((("change, making")))((("change addresses")))((("addresses", "change
|
((("change, making")))((("change addresses")))((("addresses", "change
|
||||||
addresses")))Many bitcoin transactions will include outputs that
|
addresses")))In addition one or more outputs that pay the receiver of
|
||||||
reference both an address of the new owner and an address of the current
|
bitcoins, many tranactions will also include an output that pays the
|
||||||
owner, called the _change_ address. This is because transaction inputs,
|
spender of the bitcoins, called a _change_ output.
|
||||||
|
This is because transaction inputs,
|
||||||
like currency notes, cannot be divided. If you purchase a $5 US dollar
|
like currency notes, cannot be divided. If you purchase a $5 US dollar
|
||||||
item in a store but use a $20 US dollar bill to pay for the item, you
|
item in a store but use a $20 dollar bill to pay for the item, you
|
||||||
expect to receive $15 US dollars in change. The same concept applies to
|
expect to receive $15 dollars in change. The same concept applies to
|
||||||
bitcoin transaction inputs. If you purchased an item that costs 5
|
bitcoin transaction inputs. If you purchased an item that costs 5
|
||||||
bitcoin but only had a 20 bitcoin input to use, you would send one
|
|
||||||
output of 5 bitcoin to the store owner and one output of 15 bitcoin back
|
|
||||||
to yourself as change (less any applicable transaction fee).
|
|
||||||
Importantly, the change address does not have to be the same address as
|
|
||||||
that of the input and for privacy reasons is often a new address from
|
|
||||||
the owner's wallet.
|
|
||||||
|
|
||||||
Different wallets may use different strategies when aggregating inputs
|
Different wallets may use different strategies when aggregating inputs
|
||||||
to make a payment requested by the user. They might aggregate many small
|
to make a payment requested by the user. They might aggregate many small
|
||||||
|
bitcoins but only had an input worth 20 bitcoins to use, you would send one
|
||||||
|
output of 5 bitcoins to the store owner and one output of 15 bitcoins back
|
||||||
|
to yourself as change (not counting your transaction fee).
|
||||||
|
|
||||||
|
At the level of the Bitcoin protocol, there is no difference between a
|
||||||
|
change output (and the address it pays, called a _change address_) and a
|
||||||
|
payment output.
|
||||||
|
|
||||||
|
Importantly, the change address does not have to be the
|
||||||
|
same address as that of the input and for privacy reasons is often a new
|
||||||
|
address from the owner's wallet. In ideal circumstances, the two
|
||||||
|
different uses of outputs both use never-before-been addresses and
|
||||||
|
otherwise look identical, preventing any third party from determining
|
||||||
|
which outputs are change and which are payments. However, for
|
||||||
|
illustration purposes, we've added shading to the change outputs in
|
||||||
|
<<transaction-chain>>.
|
||||||
inputs, or use one that is equal to or larger than the desired payment.
|
inputs, or use one that is equal to or larger than the desired payment.
|
||||||
Unless the wallet can aggregate inputs in such a way to exactly match
|
Unless the wallet can aggregate inputs in such a way to exactly match
|
||||||
the desired payment plus transaction fees, the wallet will need to
|
the desired payment plus transaction fees, the wallet will need to
|
||||||
|
Loading…
Reference in New Issue
Block a user