UTXO: How Bitcoin Tracks Who Can Spend What

UTXO: How Bitcoin Tracks Who Can Spend What

A UTXO (unspent transaction output) is an output of an earlier Bitcoin transaction that has not been spent yet, so a new transaction can use it as an input. In Bitcoin’s UTXO model, the blockchain records outputs instead of account balances, and a wallet’s balance is typically the sum of the UTXOs it can spend.

How Does a Bitcoin Transaction Spend and Create UTXOs?

A Bitcoin transaction has inputs and outputs. An output assigns an amount of BTC to a script. A script is a spending condition, a rule that must be met before the amount can move. Whoever can satisfy that script controls the amount.

An input points to one earlier output. It names that output by the ID of the transaction that created it and by the output’s position in that transaction. The input also supplies data that satisfies the output’s script, typically a digital signature. How keys and signatures work is covered in the entries on public and private keys and on the Elliptic Curve Digital Signature Algorithm (ECDSA) and Schnorr signatures.

An unspent transaction output stays unspent until a transaction that refers to it as an input is confirmed, which means the transaction has been included in a block, a group of transactions recorded on the blockchain. From then on the output is spent and is no longer a UTXO. A Bitcoin transaction therefore consumes UTXOs and creates new outputs, and those new outputs become the next UTXOs.

Some Bitcoin documentation and software call an unspent output a “coin.” This glossary entry uses “UTXO” and “output” instead, because “coin” also names a blockchain’s native asset, such as BTC.

How Does the UTXO Model Turn Outputs into a Balance?

The UTXO model is the way Bitcoin records who can spend what. The blockchain holds transactions and their outputs. It does not hold a running balance for each person.

A wallet’s balance is typically the sum of the UTXOs its keys can spend. A wallet typically watches the blockchain for outputs whose scripts its keys can satisfy and adds up their amounts. In the UTXO model, the balance a wallet shows is typically a calculation, not a number stored on the blockchain.

In Bitcoin, a wallet does not contain BTC itself. A wallet typically stores the private keys, and the blockchain records the outputs those keys can spend.

Some other blockchains use an account model instead. In that design, an account carries a balance that transactions change. The UTXO model tracks separate outputs, and the account model tracks one balance per account. Both designs record who can spend what.

Why Does Spending a UTXO Create a Change Output?

In the UTXO model, an output is spent whole. A transaction must assign the full value of the outputs it spends to new outputs or leave the remainder as the fee. If an output is larger than the payment, the transaction creates a second output that returns the rest to the sender, and that second output is called a change output.

The fee is the difference between the total of a transaction’s inputs and the total of its outputs. The fee is not an output of its own. The miner who includes the transaction in a block claims it, and a transaction whose outputs add up to more than its inputs is rejected.

Coin selection is the wallet’s choice of which UTXOs to spend as inputs for a payment. In this term, “coin” is the documentation’s word for an output.

The table shows an example transaction. The amounts, including the fee, are made up for illustration and are not a real transaction or a fee recommendation.

PartAmount (BTC)
Input: one earlier output, now spent0.5
Output 1: payment to the recipient0.3
Output 2: change back to the sender0.1999
Fee: input total minus output total (not an output)0.0001

In the example transaction, the two outputs, the 0.3 BTC payment and the 0.1999 BTC change, add up to 0.4999 BTC. The 0.5 BTC input minus those 0.4999 BTC leaves the 0.0001 BTC fee. Once the example transaction is confirmed, the 0.5 BTC output is spent, and the 0.3 BTC and 0.1999 BTC outputs are new UTXOs. The recipient’s wallet can spend the first, and the sender’s wallet can spend the second.

What Is the UTXO Set That Nodes Keep?

The UTXO set is the collection of all Bitcoin outputs that are currently unspent. Nodes, the computers that connect to the Bitcoin network, use the UTXO set to validate new transactions.

When a node validates a new transaction, it checks, among other things, that each input refers to an output that is still unspent. It also checks that the input’s data satisfies that output’s script and that the transaction’s outputs do not add up to more than its inputs.

The UTXO set changes with every confirmed transaction. The outputs a transaction spends leave the set, and the outputs it creates join it.

How Does the UTXO Model Handle Double Spending?

Double spending means trying to spend the same output in two different transactions. In the UTXO model, each output can be used as an input only once, and any later reference to an already spent output is a forbidden double spend. The network is designed to accept only one of two conflicting spends: once a transaction that spends an output is confirmed, a later transaction that refers to the same output is not accepted.

When two transactions try to spend the same output, which one counts is settled by which one is recorded in a block. Nodes are designed to apply the same consensus rules, which are the rules for checking transactions and blocks, and to follow the chain that took the most computing work to build. Changing a past transaction would mean redoing the block that holds it and every block after it.

The protection against double spending is designed to rest on how costly it is to rewrite the chain. Attacks that try to rewrite confirmed history, such as an attack by a party that controls a majority of the network’s hashrate, its combined computing power, are a separate topic. The entry on irreversibility of transactions covers why confirmed transactions are treated as final.

What Does a UTXO Not Tell You?

A UTXO shows that an amount is spendable by whoever can satisfy its script, and by itself it does not say who that person is. The UTXO model describes spendability, not identity or legal ownership.

A UTXO is not an address. It is an amount locked to a script, and a transaction spends it as a whole, which is why change outputs exist.

Dust is an output worth less than it would cost to spend. By default, nodes running the Bitcoin Core software do not relay transactions that create dust outputs, which means they do not pass those transactions on to other nodes. Dust is therefore a relay policy, a setting each node controls, and not a consensus rule, so a transaction with a dust output is still valid.

November 18, 2026

GoMining News

You might be interested in: