In the context of Cardano, a “UTxO” stands for Unspent Transaction Output. This concept is central to how transactions are handled on the Cardano blockchain, which is similar to how Bitcoin operates.

A UTxO is essentially a piece of cryptocurrency (like ADA in Cardano) that has been sent to a user’s wallet but has not yet been spent in a transaction. When a transaction occurs, the UTxOs from the sender’s wallet are used as inputs, and any leftover amount (after the transaction is made) becomes a new UTxO.

Authors Note ✏️

It appears to be extremely important to understand UTxOs in Cardano, so let’s simplify this concept with some ELI5. Imagine you and your friends are all playing a game where you trade marbles with each other. Each of you has a notebook, and every time you give or receive a marble, you write it down in your notebook so everyone knows who has what.

Now, instead of just you and your friends trading one at a time, imagine there are lots of kids trading marbles at the same time. To keep track of all these trades, a super smart notebook (the Cardano blockchain) is used by everyone. This smart notebook lets all of you write down your trades at the same time.

Here’s how it works:

  1. Simultaneous trades: Lots of kids (people) are trading marbles (money or data) with each other at the same time. The super smart notebook keeps track of all these trades happening together, like a big puzzle that gets solved quickly.
  2. Criss-cross trades: One kid might trade with someone far away, while two other kids trade nearby. The smart notebook knows about all these trades no matter where they happen, and it keeps everything organized.
  3. In parallel: Instead of waiting for one person to finish their trade before the next one starts, the notebook allows many trades to happen at once, like kids running around the playground trading marbles at the same time. The smart notebook doesn’t get confused and makes sure every trade is recorded correctly.

So, on the Cardano blockchain, all these transactions happen at the same time, in parallel, and they don’t have to wait for each other. The smart system makes sure everything is fair and keeps track of who has what without anyone making mistakes.

“Blockchain networks are complex data structures. Transactions continuously crisscross the chain (many transactions are happening simultaneously), creating digital footprints that require careful tracking and management to maintain the integrity and reliability of the underlying ledger.

Two major accounting ledgers exist in the blockchain space: UTxO-based blockchains (Bitcoin, for instance), and Account/Balance chains (Ethereum, and others).

Each of these crypto heavyweights differs in many fundamental ways, but this article focuses on their accounting models. Bitcoin uses an Unspent Transaction Output (UTxO) model, whereas Ethereum deploys an Account/Balance one.

Cardano sought to combine Bitcoin’s UTxO model with Ethereum’s ability to handle smart contracts into an Extended UTxO (eUTxO) accounting model. The adoption of eUTxO facilitates the implementation of smart contracts into the Cardano chain.

Cardano’s Extended UTxO accounting model – built to support multi-assets and smart contracts

Let’s break down what a UTxO is and how it functions within the Cardano network:

Why does Cardano Need UTxOs? What Problem(s) are UTxOs Solving For?

UTxOs solve a few key problems for blockchain systems, especially those like Cardano. Here’s what they’re solving for:

1. Double-Spending

  • Problem: Without a way to track which “coins” (or marbles, in my earlier analogy) have been spent, someone could try to use the same money more than once, which would mess up the system.
  • UTxO Solution: UTxOs act as receipts that show which coins are still available to be spent. Once you use a UTxO in a transaction, it becomes “spent” and can’t be used again. This prevents double-spending because the system tracks exactly what is spent and what is left.

2. Efficiency in Tracking Ownership

  • Problem: If you just kept a running total of how much money someone has, it could get messy to track multiple transactions happening at once or figure out who owns what part of a balance.
  • UTxO Solution: Instead of trying to update a single number for your balance, UTxOs break each transaction into smaller, independent parts. These “outputs” can be used in different transactions without affecting others, making it easier to manage ownership and update the ledger quickly and accurately.

3. Parallel Transaction Processing

  • Problem: In systems where everything is recorded as one big balance, transactions might need to be processed one after another, which can slow things down.
  • UTxO Solution: Since UTxOs are independent units, multiple transactions can happen at the same time (in parallel), each using different UTxOs. This makes the system faster and allows for more transactions to be processed at once.

4. Improved Security and Transparency

  • Problem: It can be hard to track where money is coming from and where it’s going if you’re only updating a single balance. This can make it easier for errors or fraud to slip in.
  • UTxO Solution: With UTxOs, every coin or portion of a coin is tied to a specific transaction history. This creates a clear audit trail, showing exactly where every unit of value came from and where it’s going, improving security and transparency.
Authors Note ✏️

Read on about the comparison of how Cardano solves these problems vs. Traditional Financial Institutions

How UTxOs Work in Cardano

  1. Transaction Inputs: In Cardano, when you want to send ADA, you use existing UTxOs in your wallet as inputs. Each UTxO is referenced by the transaction where it was created.
  2. Transaction Outputs: When the transaction is processed, new UTxOs are created. One or more outputs are generated, which can go to the recipient and back to the sender as change if the input UTxOs exceed the amount being sent.
  3. UTxO Model vs. Account-Based Model:
    • UTxO Model (Cardano, Bitcoin): Each transaction references previous UTxOs and generates new UTxOs, which are tracked independently. The balance of a wallet is the sum of all its UTxOs.
    • Account-Based Model (Ethereum): Each transaction directly modifies the account balances of the sender and receiver, similar to how a bank account works.
  4. Advantages of the UTxO Model:
    • Security and Privacy: The UTxO model can offer better security and privacy, as each transaction is unique and can be verified independently.
    • Concurrency: Cardano’s extended UTxO (eUTxO) model, an evolution of the UTxO model, allows for more complex transactions, like smart contracts, while maintaining the benefits of UTxO. It also addresses some issues of concurrency that are more challenging in account-based models.
  5. Change UTxO: If the amount of the UTxO(s) used as input is greater than the transaction amount, the difference is sent back to the sender’s wallet as a new UTxO, often referred to as “change.”

Example Scenario of Cardano UTxOs

  • Initial State: Alice has 10 ADA in her wallet, represented by a single UTxO.
  • Transaction: Alice wants to send 3 ADA to Bob.
  • Process:
    1. Alice’s 10 ADA UTxO is used as the input for the transaction.
    2. The transaction generates two outputs: 3 ADA is sent to Bob, and 7 ADA is sent back to Alice as a new UTxO (change).
  • Result: Alice now has a 7 ADA UTxO, and Bob has a new 3 ADA UTxO in their wallet.

How does Cardano handle the leftover amounts in a UTxO (“the change”)?

In Cardano, the leftover amounts from UTxOs (Unspent Transaction Outputs) are handled in a similar way to how physical cash works. Let’s break it down step by step:

1. Using UTxOs for Transactions

When you make a transaction on Cardano, you don’t spend just a portion of a UTxO; you spend the entire UTxO. This is like breaking a $20 bill to pay for something that costs $15—you don’t tear the bill in half. Instead, you hand over the whole $20 and get $5 back as change.

2. Creating “Change” UTxOs

If the UTxO being spent is larger than the amount you need for the transaction, the leftover amount becomes “change.” In the blockchain world, this “change” is sent back to you as a new UTxO.

  • For example, if you have a UTxO worth 10 ADA and you send 3 ADA to someone, the remaining 7 ADA is sent back to your wallet as a new UTxO. This process is handled automatically by the wallet.

3. Outputs in the Transaction

A Cardano transaction typically has two outputs:

  • The payment output: This is where the amount you’re sending goes (e.g., 3 ADA to another person).
  • The change output: This is the leftover amount that gets returned to your own wallet as a new UTxO (e.g., 7 ADA back to you).

4. Multiple UTXOs

As you continue making transactions, your wallet might accumulate multiple UTxOs. Each UTxO is like a separate “coin” that your wallet keeps track of. The wallet software manages these UTxOs behind the scenes, combining them as needed when you make future transactions.

5. Minimizing UTXOs

Over time, if your wallet collects too many small UTxOs (leftovers), the wallet might consolidate them automatically into fewer, larger UTxOs to optimize future transactions. This reduces transaction fees and improves efficiency.

In summary, when you spend a UTxO in Cardano, any leftover amount is automatically returned to your wallet as a new UTxO, similar to getting “change” in cash. Your wallet handles all of this for you, ensuring that your remaining balance is always tracked and available for future transactions.

UTxOs in Cardano vs. Other Blockchains

UTxOs in Cardano differ from those in other blockchains, such as Bitcoin, primarily due to Cardano’s use of the extended UTxO (eUTxO) model. This model introduces additional functionality that supports more complex transactions, including smart contracts, while maintaining the benefits of the traditional UTxO model. Here’s a detailed look at how UTxOs are different in Cardano:

1. Extended UTxO (eUTxO) Model

The eUTxO model in Cardano extends the basic UTxO model by adding more capabilities, allowing for more sophisticated transaction logic. This extension includes:

  • Smart Contracts and Scripts: In Cardano, each UTxO can carry more information than just value. It can also include a script (smart contract) that dictates how the UTxO can be spent. This script can require specific conditions to be met before the UTxO can be used, such as providing a certain piece of data or satisfying certain logic.
  • Datum: In addition to the value and script, Cardano’s UTxOs can include a piece of data called a “datum.” The datum can be referenced or required by the script, enabling more complex operations, such as those seen in decentralized applications (dApps).
Authors Note ✏️

Cardano made a deliberate decision to pivot from the traditional UTxO (Unspent Transaction Output) model, used by Bitcoin, to the eUTxO (Extended Unspent Transaction Output) model. This shift allows Cardano to support smart contracts and decentralized applications (dApps), which are not feasible under the standard UTxO model.

Cardano’s shift to the eUTxO (Extended Unspent Transaction Output) model was introduced with the Alonzo upgrade, which went live in September 2021. The Alonzo hard fork was a major milestone for Cardano because it enabled the implementation of smart contracts on the platform, making the eUTxO model necessary to support these new functionalities.

This pivot was part of Cardano’s broader plan, as laid out in its roadmap, to evolve from a simple UTxO-based blockchain to one capable of handling decentralized applications (dApps) and more complex smart contract interactions. The eUTxO model, introduced through Alonzo, is what makes this possible while maintaining Cardano’s focus on scalability, security, and efficient transaction processing.

2. Deterministic Transactions

Cardano’s eUTxO model ensures that transactions are deterministic. This means that the outcome of a transaction is predictable before it is submitted to the blockchain, which is crucial for security and reliability. Specifically:

  • Predictability: In the eUTxO model, a transaction either succeeds or fails based on the current state of the UTxOs involved, and this can be fully known before the transaction is broadcast. This predictability contrasts with some account-based models (like Ethereum), where the transaction outcome might depend on the state of the entire blockchain at the time of execution, making it harder to predict.
  • Concurrency: The deterministic nature of eUTxOs also addresses some concurrency issues. In Cardano, since UTxOs can only be spent once, each transaction operates independently of others, reducing the likelihood of conflicts when multiple transactions are processed simultaneously.

3. Scalability and Parallelism

The eUTxO model in Cardano allows for greater scalability through parallelism:

  • Parallel Processing: Since each UTxO can be processed independently, multiple transactions can be executed in parallel without interfering with each other. This is different from the account-based model, where transactions can sometimes depend on the sequence in which they are processed, leading to bottlenecks.
  • Efficient Resource Use: By enabling transactions to run in parallel, Cardano can potentially achieve higher throughput and better performance as the network grows, which is important for handling a large number of transactions simultaneously.

4. Flexibility in Transaction Design

Cardano’s eUTxO model offers more flexibility in how transactions are designed and executed:

  • Complex Transaction Flows: The combination of value, scripts, and datum allows for complex transaction flows, enabling more advanced use cases such as multi-signature wallets, decentralized finance (DeFi) applications, and non-fungible tokens (NFTs).
  • Custom Validation Logic: Developers can define custom validation logic within UTxOs, making it possible to create transactions that cater to specific business or application needs, beyond simple transfers of value.

5. Security and Privacy

The UTxO model, including Cardano’s eUTxO, inherently provides strong security and privacy features:

  • Immutable Transaction History: Each UTxO is linked to a specific transaction output, creating a clear, immutable chain of ownership that can be easily audited.
  • Privacy: UTxOs can offer better privacy compared to account-based systems, as each transaction can create new addresses (UTxOs), making it harder to trace funds back to a single entity.

The key differences in Cardano’s UTxO model compared to others lie in its extension to support smart contracts and more complex transaction logic through the eUTxO model. This provides enhanced flexibility, predictability, scalability, and security, making Cardano uniquely suited for a broad range of decentralized applications and financial services. The eUTxO model is a significant innovation that sets Cardano apart from other blockchains, particularly those that rely on traditional UTxO or account-based models.

Explain UTxO’s Like I’m Five Years Old (ELI5)

Imagine you have a piggy bank, and inside are a bunch of coins. Each coin represents money you can use, but once you use it, you can’t split it up into smaller pieces; you have to use the whole coin.

In Cardano, UTxOs (Unspent Transaction Outputs) work like those coins. When you get some money (a transaction), it’s like getting one or more coins. When you want to send money to someone else, you have to use one or more of your coins, but if you don’t need to use the entire value of a coin, you’ll get change back, just like in real life.

So, every time you spend, it’s like breaking a piggy bank to use one or more coins, and you get a new piggy bank with your change. These coins (UTxOs) are what help keep track of how much money you have!

Conclusion

In summary, a UTxO in Cardano represents a portion of ADA that has been received, but not yet spent. The UTxO model is fundamental to how transactions are constructed and processed on the Cardano blockchain, ensuring security, flexibility, and the ability to support more complex transaction types, including those involving smart contracts.

FAQs about UTxOs

1. What is a UTxO in Cardano?

A UTxO (Unspent Transaction Output) is a record of a certain amount of ADA that has been sent to your address but hasn’t been spent yet. It represents “coins” that you can use in future transactions.

2. How are UTxOs different from an account-based model?

Unlike the account-based model (used by Ethereum), where balances are tracked like a bank account, Cardano’s UTxO model treats each transaction as using whole “coins” or outputs. You can receive multiple UTxOs, and when you spend, you use them entirely, getting back change if needed.

3. What happens to my leftover UTxO balance in a transaction?

If the amount you’re sending is less than the UTxO you’re spending, you’ll receive the leftover as “change,” which creates a new UTxO in your wallet.

4. Can I combine UTxOs?

Yes, when making a transaction, you can use multiple UTxOs to cover the total amount you’re sending. The network will then “merge” them into one transaction.

5. Why are UTxOs important for Cardano?

UTXOs improve security and efficiency. Each UTxO is individually verified, and since they can’t be spent twice, they prevent double-spending. This model also supports Cardano’s parallel processing, allowing faster and more scalable transactions.

6. How does the number of UTxOs affect transaction fees?

The more UTxOs you use in a transaction, the higher the fees may be. This is because each UTxO requires individual validation, and transactions with multiple UTxOs are larger in size.

7. Do smart contracts in Cardano use UTxOs?

Yes, but Cardano uses an extended model called eUTxO (Extended UTxO) for smart contracts. This model allows for more complex operations than traditional UTxOs while maintaining the security and scalability benefits of UTxOs.

8. Can UTxOs expire?

No, UTxOs do not expire. They remain valid until they are spent in a transaction.

9. How do I check my UTxOs on Cardano?

You can use a blockchain explorer like Cardanoscan to check the UTXOs associated with your wallet address, showing how much ADA is available in each output.

10. Can UTxOs hold tokens other than ADA?

Yes, Cardano’s multi-asset support allows UTxOs to hold both ADA and other native tokens, enabling more flexible and diverse transactions. Each UTxO can store multiple assets, including custom tokens.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *