What is an unspent transaction output (UTXO)?

Spread the love

An unspent transaction output (UTXO) is a transaction output that can be used as input in a new transaction. We can say UTXOs define where each blockchain transaction starts and finishes. The unspent transaction output model is a fundamental element of Bitcoin and lots of other cryptocurrencies.
In other words, cryptocurrency transactions are made of inputs and outputs. Anytime there is a transaction, a user takes one or more UTXOs to serve as the input(s). Next, the user provides their digital signature to confirm ownership over the inputs, which finally result in outputs. The unspent transaction output consumed are now considered “spent,” and cannot be used any more. Meanwhile, the outputs from the transaction become new UTXO – which can be spent in other transactions later.
This can be explained better with an example. Imagine somebody has 0.45 BTC in his wallet. This isn’t a fraction of a coin as we might conceptualize it. It’s rather a collection of UTXO. For example, two UTXO worth 0.4 BTC, and 0.05 BTC – outputs from past transactions. Now let’s imagine that he needs to make a payment to somebody else of 0.3 BTC.
His only option here is to break up the 0.4 BTC unit and to send 0.3 BTC, and 0.1 BTC back to himself. He would normally reclaim less than 0.1 BTC due to mining fees, but let’s simplify and leave the miner out.
He creates a transaction that essentially says to the network: take my 0.4 BTC UTXO as an input, break it up, send 0.3 BTC of it and return the 0.1 BTC to my address. The 0.4 BTC is now a spent output, and can’t be reused. Meanwhile, two new UTXOs have been created (0.3 BTC and 0.1 BTC).
Note that we broke up a unspent transaction output in this example, but if he had to pay 0.42 BTC, he could just as easily have combined his 0.4 BTC with another 0.05 BTC to produce a UTXO worth 0.42 BTC, while returning 0.03 BTC to himself.
To conclude, the unspent transaction output 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). UTXO cannot be spent in part – instead, new cheques must be created from the old one and passed along accordingly.

Leave a Reply

Your email address will not be published.