Fact-checked by Grok 2 weeks ago

Unspent transaction output

An unspent transaction output (UTXO) is a discrete unit of value that remains after a has been processed, representing funds that have not yet been spent and are available to be used as in future transactions. This concept forms the core of the UTXO model, originally proposed in the whitepaper as part of a system to track unspent transaction values in a peer-to-peer network without relying on centralized intermediaries. In the UTXO model, each consumes one or more existing UTXOs as inputs, verifies their validity through cryptographic signatures, and generates new UTXOs as outputs, with the net difference for fees and any change returned to the sender. The global collection of all valid UTXOs, known as the UTXO set, serves as the dynamic state of the , enabling nodes to validate new by checking only this set rather than scanning the entire history. This approach ensures that each UTXO can be spent only once, preventing through consensus mechanisms like proof-of-work. The UTXO model offers several key advantages over account-based models used in blockchains like , including enhanced by obscuring direct links between sender balances and transaction histories, as funds are mixed from multiple UTXO sources without revealing total holdings. It also supports through stateless transaction validation, allowing of independent transactions since each can be verified against the UTXO set without interdependencies. Additionally, its simplicity in data structures facilitates efficient storage and querying for full nodes, contributing to the of networks like . However, the model presents challenges, such as the accumulation of small "dust" UTXOs from change outputs, which can bloat the UTXO set and increase storage demands on nodes over time. Effective UTXO management, including consolidation techniques in wallets, is essential to mitigate fees from handling fragmented outputs and to maintain network efficiency. The model has influenced other cryptocurrencies, such as and Cardano's extended UTXO (eUTXO) variant, which adds support for smart contracts while preserving core benefits.

Fundamentals

Definition and Core Concepts

An unspent transaction output (UTXO) is the portion of a output in a that has not yet been spent in a subsequent , serving as a discrete unit representing a specific amount of owned by a particular . This model treats as indivisible "coins" or outputs from prior , each with an associated value and ownership conditions, rather than a running balance. The UTXO thus encapsulates the fundamental in such systems, ensuring that ownership is tracked through cryptographic references to previous outputs. The core purpose of the UTXO model is to enable stateless of transactions by allowing nodes to confirm validity solely through references to prior unspent outputs, thereby preventing while maintaining immutability and security in permissionless networks. By requiring new transactions to explicitly consume existing UTXOs as inputs, the model enforces that each unit of value can only be spent once, with relying on the cryptographic integrity of the referenced outputs rather than a global state ledger. This approach supports efficient, decentralized , as full nodes maintain a set of all current UTXOs—the UTXO set—to validate incoming transactions without recomputing the entire transaction history. Key concepts in the UTXO model include the clear distinction between transaction inputs, which reference and spend existing UTXOs, and outputs, which create new UTXOs for recipients or change. Inputs effectively mark the referenced UTXOs as spent, removing them from availability, while outputs generate fresh UTXOs that become spendable once the transaction is confirmed in the . For intuitive understanding, the model is often analogized to physical : just as spending a bill consumes the original and issues new ones in change, UTXOs represent tangible units of value that are destroyed upon spending and recreated in new forms. A simple example illustrates this process: suppose an address holds a 1 BTC UTXO and initiates a to send 0.5 BTC to another ; the input references the 1 BTC UTXO (marking it as spent), while the outputs create two new UTXOs—one of 0.5 BTC to the recipient and another of 0.5 BTC as change back to the sender (minus any fees). The original 1 BTC UTXO is now invalid, and the two 0.5 BTC outputs become the new unspent units available for future transactions.

Components of a UTXO

An unspent transaction output (UTXO) in is defined by a combination of identifiers and attributes that specify its origin, value, and spending conditions. The primary identifiers are the transaction ID (TXID) of the originating transaction and the output (vout), which together form a unique reference known as an outpoint. The TXID is a 32-byte of the entire transaction, calculated by double-SHA256 hashing its serialized form in internal byte order, ensuring immutability once confirmed. The vout is a 4-byte unsigned (uint32_t) indicating the position of the output within the transaction's list of outputs, starting from 0. This pair (TXID + vout) allows any node to precisely locate and reference the UTXO across the without storing the full transaction data. The component of a UTXO specifies the amount of available for spending, measured in the smallest unit called (1 BTC = 100,000,000 satoshis). This is represented as an 8-byte signed integer (int64_t), with a minimum non-zero of 1 satoshi, though zero-value outputs are permitted in certain cases like OP_RETURN for . The enforces conservation of funds during transactions, as the sum of output values cannot exceed the sum of input values (excluding transactions). This component directly determines the economic worth of the UTXO and is crucial for balance calculations. The locking script, known as scriptPubKey, is the final core component, consisting of a variable-length byte sequence (up to 10,000 bytes, prefixed by a compactSize uint) that encodes the conditions under which the UTXO can be spent. It typically includes opcodes and data pushes, such as hashes of public keys or multisig requirements, to verify ownership. For instance, in a standard Pay-to-Public-Key-Hash (P2PKH) output, the scriptPubKey might be structured as: OP_DUP OP_HASH160 <20-byte pubkey hash> OP_EQUALVERIFY OP_CHECKSIG, which requires the spender to provide a matching the hashed public key. This ensures by requiring a corresponding unlocking script (scriptSig) in a spending to evaluate successfully against it on the . To illustrate, a sample Bitcoin UTXO could be referenced as follows: TXID abc123... (32 bytes), vout 0, amount 50000000 satoshis (0.5 BTC), and scriptPubKey 76a914<20-byte pubkey hash>88ac (in hexadecimal, equivalent to the P2PKH opcodes above). This breakdown highlights how the components interlink to form a spendable unit.

Historical Origins

Introduction in Bitcoin

The Unspent Transaction Output (UTXO) model was introduced in the Bitcoin whitepaper, titled "Bitcoin: A Peer-to-Peer Electronic Cash System," published on October 31, 2008, by the pseudonymous Satoshi Nakamoto, as a foundational solution to the double-spending problem in a decentralized electronic cash system without trusted third parties. The whitepaper proposes this model to enable direct peer-to-peer payments, where ownership of funds is tracked through verifiable chains of transactions rather than centralized ledgers. Nakamoto's design motivations centered on the UTXO model's for verifying transaction validity using only the set of unspent outputs, which avoids the need for global account balances and supports efficient operation in networks. This approach allows nodes to confirm and prevent by checking references to prior unspent outputs, promoting through decentralized without requiring all participants to maintain exhaustive historical data. In Section 2 of the whitepaper, are explicitly described as chains of digital signatures, with each owner signing a of the previous to transfer value, implicitly defining UTXOs as the discrete, spendable units that form the basis of this model. Further emphasizing these motivations, Section 8 introduces Simplified Payment Verification (SPV), enabling lightweight nodes to validate payments by storing block headers and Merkle branches linked to specific UTXOs, thus allowing resource-constrained users to participate in the network without full storage. This UTXO-based verification contrasts with account-based models, which resemble centralized bank accounting by maintaining running balances. The UTXO model debuted in practice with Bitcoin's genesis block, mined by Nakamoto on January 3, 2009, at 18:15:05 UTC, where the coinbase transaction created the initial 50 BTC output as the first unspent transaction output in the system.

Adoption in Other Cryptocurrencies

The UTXO model quickly proliferated beyond Bitcoin through early forks that preserved its core transaction structure for simplicity and security. Litecoin, launched in October 2011 as a Bitcoin fork, retained the UTXO model to support faster block generation times of 2.5 minutes while inheriting Bitcoin's unspent output tracking for balance management. Similarly, Namecoin, released in April 2011, adopted the UTXO model to enable a decentralized domain name system (DNS) on its blockchain, allowing secure registration and transfer of .bit domains as key-value pairs within transactions. Peercoin, launched on August 19, 2012, was the first cryptocurrency to combine proof-of-work and proof-of-stake consensus mechanisms while utilizing the UTXO model for transaction validation and coin minting. Dash, originally released as XCoin on January 18, 2014, and rebranded later that year, employed the UTXO model and introduced masternodes to enable features like InstantSend for faster transactions and PrivateSend for enhanced privacy. Subsequent variants introduced targeted enhancements while maintaining the UTXO foundation. , which forked from on August 1, 2017, at block height 478,558, preserved the UTXO model and Bitcoin Script but increased the block size limit to 8 MB (expanded to 32 MB in subsequent upgrades) to accommodate higher transaction throughput without altering output validation mechanics. , launched in October 2016, built directly on the UTXO model by incorporating zk-SNARKs for optional shielded transactions, enabling privacy for sender, receiver, and amount details through zero-knowledge proofs while supporting transparent UTXOs for compatibility. By 2025, the UTXO model has seen expanded adoption in layer-2 scaling solutions and specialized chains. The , a layer-2 protocol for , leverages UTXO-based bidirectional payment channels to conduct off-chain transactions at high speed and low cost, with channel openings and closures settling via on-chain UTXOs to enforce security. Ergo, mainnet-launched on July 1, 2021, employs an extended UTXO (eUTXO) model with advanced scripting capabilities to support s, applications, and non-fungible tokens while prioritizing security and scalability. Nervos Common Knowledge Base (CKB), mainnet-launched in November 2019, refines the UTXO model into its programmable Cell model, which treats cells as stateful UTXOs to facilitate execution, multi-asset support, and interoperability in a proof-of-work environment isomorphic to . The model's enduring influence stems from its strengths in and scalability contexts, often contrasting with account-based alternatives. Privacy coins like utilize a modified UTXO model with ring signatures, stealth addresses, and confidential transactions to obscure transaction graphs, promoting despite the computational overhead. This approach appeals to projects prioritizing unlinkability, unlike Ethereum's account-based model, which tracks persistent balances for seamless state management but faces challenges in and inherent . Cardano extends this lineage with its Extended UTXO (EUTXO) model, incorporating script-based validation for deterministic s.

Mechanics of Operation

Creating UTXOs

Unspent transaction outputs (UTXOs) are generated as the outputs of valid transactions within the Bitcoin network. Each transaction consumes existing UTXOs as inputs, which reference prior transaction identifiers (TXIDs) and output indices, while its outputs define new UTXOs by specifying satoshi amounts and locking scripts that determine spending conditions. These outputs become available as UTXOs once the transaction is confirmed in a block, enabling the transfer and division of value across the blockchain. A special mechanism for creating UTXOs occurs through transactions, which form the first in every and introduce new into circulation without requiring inputs. These transactions reward miners with a plus collected fees, producing UTXOs locked to the miner's specified address. In Bitcoin's genesis mined on January 3, 2009, the created an initial of 50 BTC as a new UTXO. The halves every 210,000 —approximately every four years—to enforce a predictable issuance schedule, with the current rate at 3.125 BTC as of height 840,000 in April 2024. In regular transactions, new UTXOs are created by ensuring the total value of inputs equals the total value of outputs plus a paid to miners. This conservation principle prevents value creation outside the mechanism, where are calculated as the between input and output sums. Outputs can direct funds to multiple recipients, allowing users to split UTXOs for payments or change; for instance, a transaction consuming a 1 BTC input might produce two 0.4 BTC outputs to separate addresses, with the 0.2 BTC serving as the .

Spending and Validation Process

To spend an unspent output (UTXO), a new references it as an input by specifying the transaction ID (TXID) of the previous that created the UTXO and the output index (vout) identifying the specific output within that . This input is paired with an unlocking script, known as the scriptSig, which provides the necessary data—such as a and public key—to satisfy the conditions set by the UTXO's locking script (pubkey script). Once spent, the UTXO is marked as consumed and removed from the global UTXO set, preventing reuse, while the new creates fresh outputs that become new UTXOs available for future spending. The validation process for spending a UTXO occurs when a receives a and verifies its inputs against the current UTXO set. First, the checks that the referenced UTXO exists, remains unspent, and matches the provided TXID and vout details. It then executes the unlocking script (scriptSig) concatenated with the locking script in a stack-based , ensuring the combined script evaluates to true without errors. This execution confirms that the spender meets the predefined conditions, such as providing a valid ; additionally, the verifies that the does not attempt a double-spend by cross-referencing against previously confirmed spends in the . If all checks pass, the is accepted into the mempool and may be included in a ; fees are implicitly calculated as the difference between total input value and total output value, rewarding miners for validation efforts. Bitcoin Script enables these validations through opcodes that enforce spending rules, with standard scripts like pay-to-public-key-hash (P2PKH) being the most common for UTXO spending. In a P2PKH locking script, the format is OP_DUP OP_HASH160 <PubKeyHash> OP_EQUALVERIFY OP_CHECKSIG, which requires the spender to prove control over the hashed public key via a . The OP_CHECKSIG opcode plays a central role by verifying that the provided corresponds to the public key and covers the relevant transaction data, ensuring authenticity and preventing unauthorized spends. For example, to spend a P2PKH UTXO, the scriptSig contains the followed by the full public key (e.g., <sig> <pubkey>), which the node processes as follows: the public key is duplicated and hashed to match the PubKeyHash from the locking script; if equal, OP_CHECKSIG validates the against the , marking the UTXO as spent upon success and consuming it entirely. This process maintains the integrity of the UTXO model by linking ownership through cryptographic proofs, with the entire validation being deterministic and reproducible across the network.

Model Comparisons

UTXO Model vs. Account-Based Model

The UTXO model represents state through discrete, immutable transaction outputs that serve as unspent funds, each identifiable by a unique ID and output , functioning in a content-addressable manner. In contrast, the account-based model maintains state as mutable balances associated with accounts, each identified by a fixed and augmented with a to enforce ordering and prevent replays. This fundamental divergence leads to UTXO treating as individual, non-fungible units akin to cash notes, while the account model aggregates value in ledger-like entries similar to bank balances. In the UTXO model, transactions explicitly reference prior unspent outputs as inputs, which are consumed upon spending, and generate new outputs to distribute value, enabling splitting or combining without altering existing records. The account-based model, however, handles transactions by directly debiting the sender's balance and crediting the recipient's, akin to a update, without needing to reference specific prior units. This explicit input-output structure in UTXO ensures traceability of funds through chains of transactions, whereas account-based updates rely on global state modifications for simplicity. Verification in the UTXO model supports , stateless , as each can be validated independently by checking input references against the unspent set and signatures, without requiring the entire historical . Conversely, the account-based model demands consistency with the full world , often stored in a , to compute and execute updates sequentially, potentially introducing dependencies across transactions. Double-spend prevention in UTXO occurs by marking inputs as spent once referenced, leveraging the immutable nature of the output set, while in the account model, it is enforced by verifying that the sender's suffices before applying changes.
AspectUTXO ModelAccount-Based Model
State RepresentationDiscrete, immutable outputs in a content-addressable set.Mutable balances in accounts, tracked via a global trie structure.
Transaction HandlingExplicit consumption of inputs and creation of new outputs.Direct balance adjustments without input references.
VerificationParallel, stateless checks against unspent set.Sequential execution requiring full state consistency.
Double-Spend PreventionMarking specific outputs as spent upon use.Balance sufficiency checks before updates.
Node RequirementsPruneable UTXO set (e.g., ~11 GB as of mid-2025).Full state trie (e.g., ~250 GB as of late 2025 and growing).

Key Advantages and Limitations

The UTXO model provides enhanced compared to account-based systems because it does not maintain a persistent balance for addresses, making it more difficult to link multiple transactions to a single user by treating each output as an independent unit. This structure allows users to generate new addresses for each transaction, obscuring ownership trails without directly tracking account histories. For instance, mixing services like CoinJoin exploit this by combining multiple users' UTXOs into a single transaction, expanding the anonymity set and complicating forensic analysis of fund origins. In terms of , the UTXO model supports parallel transaction processing since outputs are discrete and do not require global updates, enabling nodes to verify transactions using only the UTXO set rather than the entire history. This reduces bandwidth and storage demands for non-full nodes, facilitating broader participation. Security benefits arise from the immutability of spent outputs, which inherently prevents attacks by design, as each UTXO can only be consumed once in a valid transaction. However, the model faces limitations in , as the global UTXO set grows continuously with new unspent outputs—for example, reaching approximately 11 as of mid-2025—imposing higher storage requirements on full nodes and slowing initial downloads. Handling change outputs introduces complexity, where returning excess funds to a new can inadvertently leak if wallet software reuses patterns or consolidates UTXOs inefficiently. The UTXO model's stateless nature also makes it less intuitive for complex smart contracts, as it lacks built-in support for maintaining ongoing like balances in (DeFi) applications, often requiring workarounds that increase transaction overhead. In real-world impacts, the encouragement of address non-reuse in UTXO systems aids quantum resistance, as public keys remain unexposed for unspent outputs until spending occurs, mitigating risks from algorithms like Shor's that could derive private keys from revealed public keys. Conversely, DeFi implementations on UTXO chains struggle with , leading to higher complexity and potential inefficiencies in protocols requiring frequent interactions. However, is exploring solutions like state expiry to mitigate state growth and enable stateless clients.

Advanced Variants

The Global UTXO Set

The global UTXO set represents the aggregated collection of all unspent transaction outputs across the , functioning as a dynamic database that tracks the current state of spendable bitcoins. This set is maintained by full nodes, which update it with every validated block by incorporating new transaction outputs while removing those spent as inputs, ensuring a real-time snapshot without requiring traversal of the entire history. For storage efficiency, Core implements the UTXO set using a key-value database such as , often augmented with caching mechanisms to accelerate lookups during validation. As of mid-2025, the UTXO set comprises approximately 170 million entries, occupying around 11 GB of disk space under standard configurations, reflecting steady growth driven by volume and output creation. Full manage this size through optional pruning of historical data, retaining only the UTXO set and recent blocks to minimize storage demands while preserving validation capabilities. In the consensus process, full nodes rely on the UTXO set to validate incoming by confirming that referenced inputs exist, remain unspent, and meet spending conditions like script signatures. This enables efficient rule enforcement without reprocessing prior blocks, contributing to Bitcoin's for verification. Simplified Payment Verification (SPV) clients, used in lightweight wallets, query full nodes for balance checks and use Merkle proofs to verify transaction inclusion in blocks, avoiding the need to store the full set locally. A key challenge for the UTXO set is the accumulation of dust UTXOs—outputs with values below the minimum viable fee threshold, often resulting from change or spam —which inflate set size and increase validation overhead without economic utility. For instance, such has contributed to recent expansions from under 5 to over 11 in the set's footprint. Users and nodes address this through consolidation , which combine multiple small UTXOs into fewer larger ones during low-fee periods, thereby reducing bloat and future costs.

Extended UTXO (EUTXO) Model

The Extended UTXO (EUTXO) model was developed by (IOHK) researchers as an enhancement to the standard UTXO model, specifically for integration into the Cardano blockchain, which launched its mainnet in September 2017. The model enables support for sophisticated s by embedding state and logic directly into transaction outputs, a design formalized in a 2020 academic paper that outlines its use in Cardano's ledger and the platform. Plutus capabilities, which leverage EUTXO for on-chain contract execution, were activated through Cardano's Alonzo hard fork upgrade on September 12, 2021. This extension addresses limitations in Bitcoin's original UTXO by allowing outputs to carry not just value but also contract-specific data and validation rules, thereby facilitating deterministic state transitions without introducing a global shared state. In the EUTXO model, each unspent output is structured as a consisting of a validator script ν, a (such as amounts), and a datum δ representing state, such as a counter or ownership details. To spend an input, a must supply a redeemer ρ—arbitrary data like a proposed —and the full context tx, which the validator script evaluates via the ν(, δ, ρ, tx) to return true or false. This validation occurs on-chain but relies on off-chain computation to predict outcomes and fees deterministically, ensuring predictability in resource usage unlike Ethereum's account-based model, where execution happens fully on-chain and can vary due to network conditions. By passing the entire to validators, EUTXO enforces : new outputs must reference prior states correctly, preventing unauthorized changes while maintaining the parallelism of standard UTXO, as independent s do not interfere. Compared to the standard UTXO model, EUTXO introduces programmability for complex logic, such as state machines, without sacrificing concurrency or simplicity; for instance, a might lock value in a UTXO with a datum δ specifying levels, where a buyer spends it by providing a redeemer ρ indicating the item selected, and the checks sufficiency before creating a new output with updated and change. This design supports applications like multi-signature or , where state evolves through chained outputs rather than mutable accounts. The model's emphasis on local validation per output enhances security by isolating states, reducing risks from interconnected global changes. As of , the EUTXO model remains central to Cardano's ecosystem, underpinning its decentralized applications and ongoing upgrades that enhance scalability and multi-asset support. It has influenced other projects, notably , a proof-of-work launched on July 1, 2019, which adopted EUTXO to enable advanced programmability while inheriting UTXO's properties. Ergo's implementation extends the model with features like sigma protocols for efficient validation, demonstrating EUTXO's role in overcoming traditional UTXO constraints in environments.