No history yet

UTXO Architecture

Cash, Not Accounts

Most financial systems we use, from bank accounts to Ethereum, operate on an account-based model. Your bank knows you have a balance of, say, $1,200. When you spend $50, they debit your account, and it now shows $1,150. Simple.

Bitcoin works differently. It doesn't know about balances or accounts. Instead, it tracks individual, discrete pieces of bitcoin. Think of it like physical cash in your wallet. You don't have a "balance" of $56; you have a $20 bill, three $10 bills, a $5 bill, and a $1 bill. Each of these is a separate, spendable item.

In Bitcoin, these individual pieces of digital cash are called Unspent Transaction Outputs, or UTXOs for short. Every bitcoin in existence is part of a UTXO, waiting to be spent. When you "send" bitcoin, you aren't debiting an account. You're selecting specific UTXOs you own, bundling them together, and creating new UTXOs for the recipient and for yourself as change.

Lesson image

Anatomy of a Transaction

Every Bitcoin transaction is made up of two main parts: inputs and outputs.

Inputs are the UTXOs you're spending. An input is essentially a pointer to a previous transaction's output that was sent to you. By including it, you're saying, "I want to spend this specific piece of bitcoin that I own."

Outputs are the brand-new UTXOs created by your transaction. Each output has two components: a value (how much bitcoin) and a locking script that specifies the conditions required to spend it in the future. Typically, you create at least two outputs: one for the person you're paying, and one for your own "change address" to receive the leftover amount.

A fundamental rule is that the total value of the inputs must be greater than or equal to the total value of the outputs. The small difference, if any, is the transaction fee paid to miners who secure the network.

This structure might seem more complex than a simple account balance, but it offers significant advantages.

The Keys to the Vault

How does the network know you actually own the UTXOs you're trying to spend? This is managed through a pair of simple yet powerful scripts embedded in every transaction.

When a UTXO is created, it includes a locking script known as ScriptPubKey. This script sets the conditions for spending the output. In a standard transaction, it essentially says, "Anyone who can prove they own the public key that hashes to this address can spend this bitcoin." It acts like a lock on a digital safe.

To spend that UTXO, you must provide the corresponding unlocking script, or ScriptSig. This script contains your digital signature (created with your private key) and your public key. When you broadcast a transaction, nodes on the network run these two scripts together. If the unlocking script correctly satisfies the conditions of the locking script, the transaction is valid. Your signature proves you own the private key associated with that UTXO, unlocking the funds.

This system is powered by Bitcoin Script a simple, stack-based programming language. While its capabilities are intentionally limited to prevent complex, looping programs, it's flexible enough to enable more advanced transaction types beyond simple payments.

Benefits and Trade-offs

The UTXO model is a core reason for Bitcoin's robustness and security. One major benefit is parallel validation. Since each transaction is a self-contained unit that spends specific, independent UTXOs, multiple transactions can be verified by the network simultaneously without conflict. In an account model, two transactions trying to debit the same account must be processed sequentially to prevent a double-spend, creating a potential bottleneck.

Privacy is another key advantage. By using a new change address for every transaction, you can break the link between your transactions. If you always received change back to the same address, anyone could easily trace your entire transaction history. The UTXO model encourages better privacy practices, though it doesn't guarantee anonymity. Reusing addresses across multiple transactions can still allow an observer to link your activity.

This model, where transactions are independent and stateless, simplifies the logic for nodes in the network. A node only needs to check if an input UTXO exists in the current set of unspent outputs. It doesn't need to calculate or store the balance of every address on the network.

Quiz Questions 1/5

What is the fundamental difference between Bitcoin's UTXO model and a traditional bank's account-based model?

Quiz Questions 2/5

In a Bitcoin transaction, the 'inputs' are essentially pointers to previously received, unspent outputs that the sender is now spending.

The UTXO model is a foundational element of Bitcoin's design, favoring parallelism and privacy over the intuitive simplicity of an account balance.