მთავარი
ლექსიკონი
Unspent Transaction Output (UTXO)

Unspent Transaction Output (UTXO)

Intermediate

An unspent transaction output (UTXO) refers to a transaction output that can be used as input in a new transaction. In essence, UTXOs define where each blockchain transaction starts and finishes. The UTXO model is a fundamental element of Bitcoin and many other cryptocurrencies.

In other words, cryptocurrency transactions are made of inputs and outputs. Anytime a transaction is made, 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 UTXOs consumed are now considered "spent," and can no longer be used. Meanwhile, the outputs from the transaction become new UTXOs – which can be spent in a new transaction later.

This is probably better explained with an example. Alice has 0.45 BTC in her wallet. This isn’t a fraction of a coin as we might conceptualize it. It’s rather a collection of UTXOs. Specifically, two UTXOs worth 0.4 BTC, and 0.05 BTC – outputs from past transactions. Now let's imagine that Alice needs to make a payment to Bob of 0.3 BTC.
Her only option here is to break up the 0.4 BTC unit and to send 0.3 BTC to Bob, and 0.1 BTC back to herself. She would normally reclaim less than 0.1 BTC due to mining fees, but let's simplify and leave the miner out.

Alice 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 to Bob’s address 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 UTXO in this example, but if Alice had to pay 0.42 BTC, she could just as easily have combined her 0.4 BTC with another 0.05 BTC to produce a UTXO worth 0.42 BTC, while returning 0.03 BTC to herself.

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.