Have you just made a Bitcoin payment and discovered that part of your Bitcoins are transferred to an unknown address? Do not worry. Your wallet it not compromised or is neither a bug. They are just send to a change address that you own and is one of the key privacy feature of Bitcoin.
This happens often. Whether it is a QT wallet, electrum wallet, hardware wallet or whichever Bitcoin wallet it is. Whenever a person sends some coins from their wallet; a specified amount of coins will be send to the intended recipients Bitcoin address and the remainder amount will be returned back to the senders BTC address. Not to the same address but to the change address that is associated with the spenders Bitcoin wallet.
Most users will not notice this change output until they examine their address on a block explorer. Also for beginners this concept tend to be confusing because their BTC address balance will not be accurate and doesn’t add up to the total balance displayed by their wallet. It is because the total balance displayed by the wallet is the balance of all address which includes both the receiving address as well as the change address.
So now what is change address or change output and how it works? Also why send Bitcoin “change” to different address and why not to the original address which the sender used?
Change address and output explained
In Bitcoin; change output is nothing but the remainder amount or the extra amount of satoshi which the spender used in a transaction but is returned back to the spender itself. It is returned back because they don’t wish to pay anything more than the specified amount. The address to which the change output is returned back is called change address. This change address is usually a new Bitcoin address which the client (Bitcoin wallet) generates for the sender to receive back the difference amount.
So instead of getting the difference back why not pay the exact amount of Bitcoins in first place?
To understand the concept of change address or change output let’s first understand the fundamentals of Bitcoin transaction.
Fundamentally every Bitcoin transaction consist of three things: A transaction input, output and the amount (BTC) used. The transaction input is the address from which the Bitcoins are sent. The transaction output is the address to where the Bitcoins are sent.
Now blockchain is a huge record of data that keep tracks of all Bitcoin transactions from beginning till now. So basically if you own some Bitcoins; the blockchain will have reference to all the previous transactions that constructed Bitcoin to your address.
Before you can send your Bitcoin to someone they were first send to you from someone else address, right?. The address that send to you is the transaction input and the address that received Bitcoin (your BTC address) is the transaction output.
Now if you wish to send your Bitcoin to another person; the address from which you send BTC will become the transaction input. The other person that is the recipient BTC address that receives your Bitcoin will become the transaction output. So basically at some point outputs might become inputs depending on if they are being spend or not.
If the outputs are not part of another transaction (not spent) then that is where the coins are actually present and is called Unspent Transaction Output (UTXO).
Alright! Now as you have understood inputs, outputs and UTXOs let’s get into the actual topic that is “Change”. Why and how change outputs are created?
Bitcoin change output
In Bitcoin and basically many other cryptocurrencies the UTXO (Unspent Transaction Output) is indivisible. That is when the output of previous transaction becomes the input of another transaction it needs to be spend in its entirety. It cannot be divided and it is the rule. The Bitcoin protocol only allows you to spend the UTXO in full. This is done primarily for two reasons; security and efficiency.
Therefore, if the output is larger than what the user wish to pay in a transaction; a change output is created and it becomes the new UXTO. Likewise, if the output is smaller than what the user wish to pay then the wallet client picks up several of the users unspent outputs as an input to make up the funds.
Each output is compiled of 1 or more inputs and each inputs can be comprised of 1 or more output. So this brings us to conclusion that Bitcoin can be sent from multiple addresses and to multiple addresses all in a single transaction.
Now let us take a look at the below example to better understand the Bitcoin change address.
Example of Bitcoin “change”
Consider the following example where two parties Bob and Alice involve in a transaction.
Bob has 50 Bitcoins which he bought from an exchange and he received it in a single output. Now for some reason Bob wish to send Alice 0.5 BTC. However Bob only have one input of 50 BTC.
Since UTXO are indivisible Bob cannot simply send the 0.5 BTC alone. Instead he is required to spend the entire input. That is he spends the entire 50 Bitcoin in a single transaction creating two new UTXOs. One output of 0.5 BTC goes to the destination address (to Alice) and the other 49.5 BTC returns back to the change address which Bob owns.
Example of multiple inputs:
Here is another example where Alice seem to have accumulated several unspent outputs from different people. Alice’s wallet now contains three unspent outputs valued at 0.5 BTC, 0.1 BTC and 0.2 BTC.
Now this time Alice wish to pay Nancy 0.8 BTC. However she doesn’t have 0.8 BTC in a single unspent output. So she uses multiple outputs to add up the total value.
Understanding “Change” in Bitcoin
Is the concept of Bitcoin change address and output still confusing? Alright! Let us take a look at another example which we practice in our day to day lives.
Bitcoin works similar to the way physical cash works.
Let us assume that you have a $100 bill. You went to a coffee shop and had a coffee worth of $25. Now to pay the $25 will you rip the bill? No
You’ll pay the whole $100 bill to the cashier. The cashier takes $25 for the coffee and returns you back the $75 as change. Now since US Dollar bills have fixed denominations your transaction may look something like this:
- $100 (You paid to the cashier)
- $25 goes to cashier
- $20 change back to you
- $20 change back to you
- $20 change back to you
- $10 change back to you
- $5 change back to you
A transaction worth of $100 has been taken place where $25 was paid to other person and $75 was returned back to you as change.
Note: Did you notice how the change amount is not available in your wallet until the cashier paid it back. Just like that in Bitcoin the change output is not available for you to spend until the transaction gets confirmed.
To know more read about Bitcoin confirmations.
Now this is exactly how a “change” in Bitcoin works. Except in Bitcoin; the bills are called unspent transaction output (UTXO). Also unlike your physical cash transaction; Bitcoin transaction involves transaction fees.
Here is another instance of real transaction involving transaction fees.
In the above transaction what happened is: Address “1GBXjHxe74s7HPR97PvdxPYdghsphcLAZG” sent a payment of 0.00157800 to address “1GBfXw6BaHdo2nggNedFhKJGBi2Yhurmoc“.
However the total inputs involved was 0.03961452 BTC. After paying the transaction fee of 0.00000582 and a payment of 0.00157800 to the recipient address the change amount of 0.0380307 was returned.
As you can see the change amount is returned to a different address rather than the one which the sender originally used. Anyways the change address is in senders possession.
Now you might wonder how the change address is created?
How are change address created?
In the early days of Bitcoin; users are asked to input the change address manually whenever their transaction involved change output. As you can guess, this lead to so many confusion and users lost Bitcoins in the process. Many users accidentally sent change to the wrong address to which they don’t have control.
Now thanks to all the latest Bitcoin wallets that takes care of creating and managing the change address automatically. Before a transaction is initiated your wallet creates the address and assigns it to receive the change output.
It all happens automatically in the wallet background. And do not worry. Since the change address is created by your wallet; your wallet contains the private key of that address. This allows you to spend the extra coins from the change address again. Only thing is as we said before you need to wait for certain block confirmations.
Bitcoin core, electrum and most other wallets are designed to handle this process very well. And you’ll usually find the change addresses in the address tab.
Now the next question most of you have is: Why not receive Bitcoin “change” back to the same address?
Receiving change to same address degrades privacy
Well you can send the change output to the same address. While sending to same address simplifies accounting it reduces users privacy. As we said earlier in this article change addresses play a key role in improving privacy.
By design every Bitcoin transactions are stored permanently on the blockchain. This system is completely transparent and is viewable by everyone. Anybody can trace or check any transaction anytime and easily understand from where the amount was sent and to whom. By linking personal identities one can easily begin to draw conclusions about the persons financial history. This is something alarming and most do not prefer.
So to preserve anonymity and to make the job of tracing transaction more difficult change outputs are usually send to a newly created change address.
Hope it explains everything about Bitcoin change address and output.
The next time if you sent Bitcoins to someone and if you notice a large amount of BTC are transferred to another address, then do not worry. They are your money and the address you see in the transaction is a change address that you control.
Did you find this article educational? Then you may want to read the following articles which will help you learn Bitcoin more.