- UTXOs are the leftover digital currency after a confirmed transaction, similar to the change we receive after making a payment.
- Bitcoin transactions are combinations of inputs, outputs, and exchange of data.
Bitcoins are digital currencies as they do not physically exist. Bitcoin transactions allow users to use their tokens for trading or commerce, however, these transactions are simply the exchange of data, specifically the input and output data.
The Bitcoin network runs on the UTXO model to maintain its ledger of transactions and allows only valid transactions to be confirmed.
What Is the UTXO Model?
UTXO stands for Unspent Transaction Output and it represents the amount of tokens left with a person after all of their previous transactions. However, this model is different from the bank and account model with which we are familiar. Let’s understand it clearly with an example:
Suppose Jacob has received the three given transactions:
- Ron >> 0.5BTC >> Jacob
- Harry >> 1BTC >> Jacob
- Will >> 1.4BTC >> Jacob
Here, all these three transactions are inputs for Jacob as he can use them for his transactions. The digital wallet of Jacob will show a balance of 2.9 BTC. All these three transactions are also UTXOs of their previous transactions.
Now, Jacob decides to purchase an NFT through Bitcoins which costs 1.1 BTC. Here, Jacob can use the one with Will as an input or the combination of Ron and Harry to carry out the transaction.
Let’s assume he uses the one with Harry.
Jacob >> 1.1 BTC >> Linda
>> 0.3 BTC leftover >>
Here, after the transaction, an amount of 0.3 BTC will be left which cannot be simply ignored but has to be used in one of the following three ways:
1. Send this amount back to yourself
2. Use this amount to pay the gas fees to the miner.
3. Spend this amount.
If Jacob does not use the money for gas fees, then no miner will add that transaction to a block and it will never get confirmed. Jacob’s money will be refunded. It is generally assumed that an undefined transaction will be utilized in the gas fees.
Here, by using one input (1.4BTC), it created two outputs (1.1BTC and 0.3BTC).
These two outputs are the new UTXOs as they are unspent presently. They can be used for future transactions. The transaction between Will and Jacob can now never be used again for a further transaction. However, Jacob can still use the one from Ron and Harry as these inputs are still unused/unspent.
This example makes it clear how Bitcoin simply exchanges data to maintain its ledger and validate the transactions. A major advantage of the UTXO model is that it prevents double spending, which is using the same input for more than one transaction.
UTXOs are also used in the Runes Protocol, which allows for the creation and trading of fungible tokens on the Bitcoin network. Runes tokens can be stored and managed using specialized Bitcoin Web3 wallets like Xverse.
In an account and balances model used in banks and familiar to all of us, the banks simply display the final balance after a transaction.
In the previous example, Jacob’s balance will simply show 2.9 BTC and after the payment request, 1.8 BTC. It does not take into account the sender and receiver, just the requested amount must meet the balance amount.
Final Thoughts
The UTXO set represents the total UTXOs in a network and during a transaction, elements from this set are consumed and the new ones are continuously added. This set gives an idea of all the tokens in circulation in a network. This model serves as a mechanism to track all the coins and their owners at any point in time.