In
cryptocurrencies
A cryptocurrency, crypto-currency, or crypto is a digital currency designed to work as a medium of exchange through a computer network that is not reliant on any central authority, such as a government or bank
A bank is a financial i ...
, an unspent transaction output (UTXO) represents some amount of digital currency which has been authorized by one account to be spent by another. UTXOs use public key cryptography to identify and transfer ownership between holders of public/private key pairs. UTXOs are formatted with the recipient's public key, thus restricting the ability to spend that UTXO to the account that can prove ownership of the associated private key. The UTXO can only be spent if it includes the digital signature associated with the public key attached the last time it was sent.
Each UTXO represents a chain of ownership implemented as a chain of
digital signatures
A digital signature is a mathematical scheme for verifying the authenticity of digital messages or documents. A valid digital signature, where the prerequisites are satisfied, gives a recipient very high confidence that the message was created b ...
going back to the origin of the coin. This is true whether the coin was created by mining, staking, or another minting procedure defined by the protocol.
Bitcoin
Bitcoin ( abbreviation: BTC; sign: ₿) is a decentralized digital currency that can be transferred on the peer-to-peer bitcoin network. Bitcoin transactions are verified by network nodes through cryptography and recorded in a public distr ...
is an example of a cryptocurrency that uses the UTXO model. An extended version of the UTXO model (EUTXO) is used for the
Cardano blockchain.
UTXO model vs. account model
The many cryptocurrencies that use the UTXO model do not use accounts or balances. Instead, individual coins (UTXOs) are transferred between users, much like physical coins or cash.
The UTXO model treats currency as objects. The history of a UTXO is stored only in the blocks when it is transferred, and to find the total balance of an account one must scan each block to find the latest UTXOs which point to that account. UTXOs are valid no matter their age; it is only necessary to acknowledge their ownership when they are sent, and not in each and every block. Though all nodes on a single chain must all agree on the block history, the relevant blocks to any single account's balance will likely be unique to that account.
On the other hand, an account model keeps track of each account and its respective balance for every block added to the network. This allows account balances to be checked without scanning historical blocks, but increases the raw size of each block (compression of unchanged account balances can reduce space requirements). Checking account balances is quicker, but like the UTXO model, fully verifying the origin of coins still requires auditing past blocks to the coin's origin.
UTXO set
The total UTXOs present in a
blockchain
A blockchain is a type of distributed ledger technology (DLT) that consists of growing lists of records, called ''blocks'', that are securely linked together using cryptography. Each block contains a cryptographic hash of the previous block, a ...
represents a
set
Set, The Set, SET or SETS may refer to:
Science, technology, and mathematics Mathematics
*Set (mathematics), a collection of elements
*Category of sets, the category whose objects and morphisms are sets and total functions, respectively
Electro ...
, every transaction consumes elements from this set and creates new ones that are added to the set. Thus, the set represents all the coins in a particular cryptocurrency system. The complete UTXO set can be summed to calculate the total supply of a cryptocurrency at a given point in time.
Outputs are a superset of UTXOs. Accordingly, UTXOs are a subset of the outputs
superset
In mathematics, set ''A'' is a subset of a set ''B'' if all elements of ''A'' are also elements of ''B''; ''B'' is then a superset of ''A''. It is possible for ''A'' and ''B'' to be equal; if they are unequal, then ''A'' is a proper subset of ...
. Bitcoin UTXO lifespans have been studied.
In the case of a valid blockchain transaction, unspent outputs (and only unspent outputs) may be used to fund further transactions. The requirement that only unspent outputs may be used in further transactions is necessary to prevent
double-spending
Double-spending is a fundamental flaw in a digital cash protocol in which the same single digital token can be spent more than once. Due to the nature of information space, in comparison to physical space (as in: valuable physical resources), a di ...
and fraud.
For this reason, inputs on a blockchain are removed from the UTXO set when a transaction occurs, whilst at the same time, outputs create new UTXOs, which are added to the UTXO set. These unspent transaction outputs may be used (by the holders of
private keys; for example, persons with
cryptocurrency wallet
A cryptocurrency wallet is a device, physical medium, program or a service which stores the public and/or private keys for cryptocurrency transactions. In addition to this basic function of storing the keys, a cryptocurrency wallet more often a ...
s) for the purpose of future transactions.
Origins
The UTXO model can be attributed to Hal Finney's ''Reusable Proofs of Work'' proposal, which is based on Adam Back's 1997
Hashcash
Hashcash is a proof-of-work system used to limit email spam and denial-of-service attacks, and more recently has become known for its use in bitcoin (and other cryptocurrencies) as part of the mining algorithm. Hashcash was proposed in 1997 by Adam ...
proposal.
See also
*
Distributed ledger
A distributed ledger (also called a shared ledger or distributed ledger technology or DLT) is the consensus of replicated, shared, and synchronized digital data that is geographically spread (distributed) across many sites, countries, or institutio ...
References
Cryptocurrencies
Digital currencies
Financial cryptography
Payment systems
Distributed computing
{{Cryptocurrency-stub