Liminal secures FSP license from FSRA in ADGM   Read more

What is Unspent Transaction Output (UTXO)?

Team Liminal

Share this article

Tips for your Crypto wallet

A blockchain is a digital, decentralized, and distributed ledger system. Operating on a peer-to-peer (P2P) network, it involves participants referred to as nodes. This ledger records transaction data and takes the form of a linked sequence of blocks, with its distinguishing characteristic being the cryptographic linkage between these blocks. The primary objective of the blockchain is to facilitate transactions.

Within a single transaction, there exist various distinct structures, each bearing unique semantic significance. The following are the different structures present in the blockchain transaction:

Transaction Version Number is a numerical identifier denotes the transaction’s type within the network. It empowers a node to ascertain the specific set of rules governing the verification of said transaction.

Unlock the potential of digital assets for your institution

 A transaction’s output comprises a cryptographic lock and a timestamp. Transaction input encompasses a pointer and an unlocking key. The pointer directs attention to the preceding transaction output, while the unlocking key serves the purpose of unlocking the corresponding prior output. Whenever an input successfully unlocks an output, it is duly marked within the blockchain database as “spent.”

Lock time is a parameter that specifies whether a transaction can be promptly incorporated into the blockchain or necessitates a specific waiting period before inclusion.

Unspent Transaction Outputs (UTXO) denotes all those transaction outputs that are yet to be unlocked by a corresponding input.

It is noteworthy that once an output is successfully unlocked, it is subtracted from the total circulating supply, and new outputs acquire their positions. Consequently, the cumulative value of unlocked outputs consistently aligns with the total value of newly generated outputs, ensuring an equilibrium in the transaction process.

Secure and manage your digital assets with Liminal

Key Takeaways

  • Unspent Transaction Output (UTXO) refers to the remaining balance of a cryptocurrency after a particular transaction has taken place.

What is Unspent Transaction Output?

The term Unspent Transaction Output, or UTXO, signifies a blockchain transaction’s output that hasn’t yet been utilized as an input in a subsequent transaction. Bitcoin serves as the quintessential example of a cryptocurrency employing this methodology.

In every bitcoin transaction, there are two key components: the input, which denotes the source address from which the Bitcoin is sent, and the output, which indicates the destination address.

The user possesses control over the output of a transaction, enabling them to spend it in a future transaction. This stands in stark contrast to traditional bank accounts, which track debits and credit and furnish a monthly statement featuring an ongoing balance.

Under the blockchain UTXO model, the total wealth or balance within a wallet corresponds to the aggregate of all unspent transaction outputs. It’s similar to receiving change after making one or more purchases, which can subsequently be used for further transactions.

 

Examples no. 1:

UTXOs operate in a manner similar to cash transactions, where the full amount must be spent, and any surplus is received as change. For instance, if you wish to buy a $20 book but only have a $50 bill, you must use the entire $50 bill and receive $30 as change. Similarly, in the cryptocurrency domain, you cannot dispatch a specific sum from a UTXO blockchain.

Consider the scenario where Bob intends to send 2 BTC to someone, such as Alice, but possesses a UTXO crypto worth 5 BTC in his wallet. In this case, he must send the entire 5 BTC UTXO to Alice and subsequently obtain the remaining 3 BTC as ‘change’ in a new, smaller UTXO crypto. This entire process is managed by the blockchain protocol and does not necessitate trust on the part of the recipient to return the change.

Within the blockchain network, the transaction results in:

2 BTC sent to Alice.

2.99 BTC returned to Bob.

0.01 BTC allocated as a miner’s fee for processing the transaction.”

Unspent Transaction Output UTXO Model

At the protocol level, the UTXO model does not incorporate wallets. It operates on the basis of individual transactions that are grouped into blocks. This blockchain UTXO model is widely adopted across numerous cryptocurrencies, with Bitcoin being a prominent example.

In UTXO-based cryptocurrencies, the concept of accounts or balances is not utilized. Instead, blockchain UTXOs are exchanged among users, resembling physical cash transactions.

While each transaction within the UTXO blockchain model can potentially shift the system to a new state, achieving this with every transaction is impractical. Network participants must ensure they remain synchronized with the current state of the system.

How is a UTXO created?

UTXOs come into existence by utilizing existing UTXOs. Each Bitcoin transaction consists of inputs and outputs, where inputs spend an existing UTXO blockchain, while outputs generate a new UTXO.

 

Significance of the UTXO Model

Language-Independent Smart Contracts: UTXO-based smart contracts enable the development of distinctive consensus mechanisms.

Support for Decentralized Exchanges and Atomic Swaps: The UTXO blockchain model facilitates atomic swaps, empowering peer-to-peer cryptocurrency trading without intermediary involvement. This feature enhances direct wallet-to-wallet cryptocurrency transactions.

Scalability Advantages: The capacity for concurrent transaction processing reduces computational strain on blockchain networks, enhancing scalability.

Privacy and Security: The use of new addresses for each Unspent Transaction Output’s transaction makes transaction tracking virtually impossible, improving privacy and security.

Prevention of Double Spending: UTXOs can only be used once, a fundamental safeguard in blockchain technology that ensures currencies are not spent more than once.

Enhanced Flexibility: UTXOs offer greater flexibility compared to traditional fiat currency systems.

Streamlined Parallelization: The UTXO crypto model simplifies the parallelization of transactions within smart contracts.

 

Example no. 2:

To gain a better understanding of how transactions operate, let’s examine another example: 

  • Let’s assume we have received bitcoins through various transactions, with each of these transactions representing a blockchain UTXO.
  • Now, we intend to purchase a car priced at 0.5 BTC.
  • To facilitate the transfer of 0.5 BTC, we must select one or more transactions as inputs.
  • This is where bitcoin transactions differ from traditional banking methods. In a bank transaction, one would simply input the desired amount of 0.5 BTC, press ‘transfer,’ and it would be sent to the seller. However, in the realm of bitcoin, it’s necessary to choose one or more UTXO cryptos as inputs.
  • In the world of cryptocurrency, there isn’t a concept of a specific amount sitting in your account.
  • To make our car purchase, we’ll select 0.7 BTC from Sarah’s blockchain UTXO as the input
  • In the UTXO crypto system, the input amount cannot remain unspent; you cannot simply leave the 0.2 BTC unused.
  • The remaining 0.2 BTC must be utilized in one of three ways:
  • Return the remaining amount to your account, as demonstrated in the previous example.
  • Employ the remaining amount as a transaction fee. It’s important to note that a transaction fee is necessary; otherwise, miners will not include your transaction in a block, and it will remain unconfirmed.
  • Send the remaining amount to another recipient.
  • In the current scenario, where 0.5 BTC has been sent to the seller without the inclusion of a fee, the transaction has not been confirmed. After 72 hours, 0.7 BTC will be automatically refunded.
  • To successfully transfer the funds to the seller, we will designate the 0.2 BTC as the transaction fee.
  • To specify a transaction fee, no explicit mention is required. If you don’t send the remaining amount to another party, it is automatically considered a transaction fee.
  • Now that the transaction fee has been included, a miner incorporates this transaction into a block and earns 0.2 BTC as the transaction fee.
  • Let’s revisit our initial UTXOs.
  • The UTXO from Sarah no longer exists; it served its purpose until it was utilized in another transaction, which, in this case, was the car purchase.
  • Transactions are stored within a block, and they constitute one of the four factors that affect the block’s hash. This means that if a miner alters one transaction while keeping the other four factors unchanged, the resulting hash will be entirely different.
  • The four factors that determine a block’s hash include:
  • Timestamp
  • Block Number: This represents the sequential order of the block in the chain.
  • Data: The transactions recorded in the block.
  • Nonce
  • Even a single-bit change in any of these four factors results in a complete change in the hash, demonstrating the avalanche effect.

 

 

Differences Between the UTXO and Account Balance Models

The UTXO crypto and Account Balance Models are distinct approaches for monitoring funds and transactions, with Bitcoin adopting the UTXO model and Ethereum employing the Account Balance Model.

In the UTXO blockchain model utilized by Bitcoin, transactions are segmented into discrete components, namely inputs and outputs. The user’s wallet balance maintains a record of all UTXO transactions.

In contrast, Ethereum operates on the Account/Balance model. This model mandates that the account balance must be sufficiently large or at least equal to the transaction amount being spent.

Generally, many developers regard the UTXO model as more secure and less storage-intensive compared to the Account/Balance model, which demands greater storage capacity for handling substantial data blocks.

Conclusion

In summary, UTXOs are designated for specific users, or more precisely, their public addresses. UTXOs cannot be partially spent; instead, new checks must be generated from the old ones and then transferred accordingly.

More on Crypto

In the fast-paced world of digital asset management, accuracy and completeness of transaction records are paramount….
October 28, 2024
As the Web3 community grapples with the affected exchange’s submission of 240,000 wallet addresses to the Singapore court, there is a noticeable confusion on Liminal’s role in the matter….
October 22, 2024

Find out what is the Ideal Custody Solution for you