UTXO Set

"Run the Numbers"

An unspent transaction output (UTXO) is the technical term for the amount of digital currency that remains after a cryptocurrency transaction. You can think of it as the change you receive after buying an item, but it is not a lower denomination of the currency—it is a transaction output in the database generated by the network to allow for non-exact change transactions.

This could be the last one you transferred from a crypto exchange to your wallet, or the “change” that arrived after completing a transaction with a different address.

UTXO is used in home Bitcoin, its hard forks and other distributed ledgers where a transaction consists of inputs and outputs.

Input data refers to the amount the user sends or spends, which is deducted from their account, while output data is the received funds, the remaining balance on the account that serves as input for future transactions. In this case, each cryptocurrency wallet balance consists of indivisible UTXOs.

UTXOs are utilized for calculation and tracking digital assets, providing valuable information about the location and quantity of cryptocurrencies as well as enabling transaction origin tracing. Additionally, this component facilitates the identification of the beginning and end of each transaction on the blockchain.

All UTXOs recorded on the blockchain are compiled together to provide nodes with information about where unspent outputs are available. These outputs can be used as transaction inputs. These details are stored in full nodes of the chain and help process only the output data to avoid analyzing the entire blockchain.

Upon adding another block to the chain, the system's state is updated. This reveals which UTXOs have become input data, what new balances have been created, and which addresses they belong to.

This mechanism is best understood through an example.

Let us assume that the balance in your Bitcoin wallet is 0.7 ABTC, which consists of indivisible remains from previous transactions, such as 0.6 ABTC and 0.1 ABTC.

Your balance can be presented like this:

20 mABTC +14 mABTC + 231 mABTC. A total of 265 mABTC and 3 UTXO (according to the number of terms).

You want to pay for your purchase in 16 mABTC. This number is less than each of your UTXOs. Your wallet sends the entire UTXO, in our case 20 mABTC, to another address to complete the transaction, and then receives 4 mABTC back.

Or another example:

For example, if Alice wants to pay Bob 1 ABTC and she has 2 UTXOs worth 0.5 ABTC and 0.7 ABTC, she can use both UTXOs as inputs and send an output worth 1 ABTC to Bob.

utxo

In order to claim the leftover value as change, Alice creates another output worth 0.199 ABTC, which she sends to herself. She is not able to send 0.2 ABTC to herself because she must pay a transaction fee.

Benefits of UTXO

The use of unspent transaction outputs to count funds promotes decentralization. By tracking digital currencies in this way, peer-to-peer transfers become possible, removing the need for third parties. As a result, the need for contracts and centralized accounts is obviated.

The UTXO model is capable of protecting the blockchain from double-spend attacks, which are more common in networks that do not utilize this transaction component.

In addition, UTXO enables transaction transparency without revealing identity. This is because it contains the public key of the cryptocurrency, which indicates the Bitcoin address where the funds are held.

Last but not least, the UTXO mechanism ensures privacy and security by generating new addresses every time UTXO is utilized.

Summing up, the UTXO model serves as the protocol’s mechanism for keeping track of where coins are at any given time. In a sense, they operate much like cheques: they’re addressed to specific users (or rather, their public addresses). UTXOs cannot be spent in part – instead, new cheques must be created from the old one and passed along accordingly.