CWhen we make a transaction in Bitcoin a user and then we review it we can notice that two receiving addresses appear, this is due to the address de change, also known as return address. Esta es una normal address, without anything special, but it is created by the wallet that sends the cryptocurrencies automatically at the time of making a transaction to send the coins left over from the transaction so they can be spent on future transactions. That is, the currencies that we have left after making a payment.
Generally when we make a payment in cryptocurrencies, it is usually less than the amount that we actually have in the wallet. But at the time of making the operation, all the bitcoins that are available in the sending address must be spent. So the customers Bitcoin or wallets create a new address known as change address to return the difference or remaining funds to our wallet.
How does the direction of change in Bitcoin work?
We can illustrate this process with a very simple example to understand it more clearly. If we go to a store and buy a product of € 79 euros, we pay the cashier with a € 100 euro ticket, he will give us a change of € 21 euros. Which is the difference between the value of the product and the ticket with which we pay.
Now with the money fiat, the cashier of the store will deliver the change with the authorized denomination banknotes that the central banks have created. In our example, the change would most likely be made up of two € 10 bills and a € 1 bill. Together they add up to a € 21 difference in purchase. In Bitcoin and cryptocurrencies, unlike fiat money, you have the authority to generate a change with an arbitrary denomination. In other words, the change can be generated with a denomination of € 21 directly.
So, illustrating another example, but now with a transaction with bitcoins, it would look like this:
If we make a payment for the value of 0,00473224 BTC (transaction value) and we have in our wallet a total of 0,00571224 BTC (total entries), our wallet would carry out two simultaneous operations. One with an amount of 0,00473224 BTC minus the mining fee that will be sent to the recipient that we indicate. The other operation will have a value of 0,00020796 BTC and it will be done at one of our addresses.
In other words, this second operation will direct a transaction to our exchange address. This process is carried out with the aim of avoiding double spending, since the 0,00571224 BTC that were in the shipping address were spent in full. Remaining our change of 0,00020796 BTC at another address, of which our wallet has the private keys to use them later.
Evolution of the directions of change
Previously, when making a transaction, users had to manually enter the exchange address in which they would receive the difference of the operation. A process that was quite risky, since if for some cause or error, the address of change was not set, the remaining funds went to the mineros, since any amount that is not assigned is the miner's fee.
Subsequently the wallets began to create new addresses for each transaction automatically. As we have already explained, the addresses are generated thanks to a set of public keys y private, And these had to be kept in a backup if you did not want to lose the cryptocurrencies to a problem with the wallet. Doing this for each transaction became so cumbersome that very few people had updated backups.
Everything was simplified thanks to the development of Wallets deterministic (HD). With this, the entire process is carried out automatically every time a transaction is made, and without the need for backup copies or any extra action by the user. So you don't have to worry about entering addresses manually to receive your returns or make new backups.