UTXO

UTXO stands for Unspent Transaction Output. It is a fundamental concept in many cryptocurrencies that use a model similar to Bitcoin.

In Bitcoin and similar blockchain systems, transactions don’t denote the transfer of a specific amount of cryptocurrency from one person to another. Instead, transactions consume (“spend”) one or more unspent transaction outputs (from previous transactions) and produce one or more new UTXOs that can be used in future transactions.

The UTXO model can be likened to using cash in physical transactions. If you want to buy an item that costs $15, but you only have a $20 bill, you would give the cashier the $20 bill, and they would give you $5 back as change. In the context of Bitcoin, the $20 bill is a UTXO being spent, and the $5 is a new UTXO being created for you.

In terms of Bitcoin ownership, when you say that a Bitcoin wallet has a certain balance, it means that the wallet has the private keys that can sign a transaction to spend a certain number of UTXOs. The balance of a wallet is therefore the sum of the value of its UTXOs.

It’s important to note that UTXOs can only be spent entirely. This means that if a UTXO holds 1 bitcoin and you want to send someone 0.5 bitcoins, you would consume the entire UTXO, send 0.5 bitcoins to the recipient, and send 0.5 bitcoins back to your wallet as “change” in a new UTXO.

In terms of blockchain data structure, UTXOs are essential because they are used to prevent double-spending and to ensure that only the rightful owner can spend the coins. Transactions are validated against the set of existing UTXOs, and only valid transactions (i.e., transactions that only spend existing, unspent outputs) are allowed to be included in a block.