Understanding UTXO and eUTXO in Cardano
Prince Chisomaga
Senior Backend Developer and Coach | Ethereum/Sui/Cardano Smart Contract Developer | Founder at Softzenith
UTXO stands for Unspent Transaction Output, and it is a fundamental concept in blockchain technology, particularly in cryptocurrencies like Bitcoin and Cardano. To grasp UTXO, let's break it down into simpler terms and use a real-life analogy.
What is UTXO?
In the world of cryptocurrencies, every transaction consists of inputs and outputs. When you send or receive cryptocurrency, you are essentially dealing with these outputs. A UTXO is an output from a previous transaction that has not yet been spent. Think of it as a digital "coin" that you can use in future transactions.
Real-Life Analogy
Imagine you go to a store and buy a book that costs $20. You pay with a $50 bill. The cashier takes your $50 bill and gives you $30 in change. In this scenario:
In the cryptocurrency world, when you receive funds, they come as UTXOs. If you had received a UTXO worth $50, you could use it to pay for the book. However, since you only need to spend $20, you would create a new transaction that uses the $50 UTXO as input, resulting in:
How UTXOs Work in Blockchain
Example Scenario
Let’s say you have the following UTXOs in your wallet:
Now, if you want to send 4 BTC to a friend, you can’t just take 4 BTC from one UTXO because you don’t have one that large. Instead, you can combine UTXO A (3 BTC) and UTXO B (2 BTC) as inputs for your transaction.Your transaction would look like this:
After this transaction, UTXO A and UTXO B are marked as spent, and you now have two new UTXOs: one for your friend and one for your change.
How UTXOs Work in Cardano
领英推荐
Example Scenario in Cardano
Let’s say you have the following UTXOs in your Cardano wallet:
Now, if you want to send 7 ADA to a friend, you can use UTXO A (10 ADA) as input for your transaction. Here’s how it would work:
After this transaction:
What is EUTXO?
EUTXO stands for Extended Unspent Transaction Output. It builds on the UTXO model by adding more functionality. Imagine if, in addition to cash, you could also attach notes or instructions to your bills. This is what EUTXO does—it allows you to include extra information (called "datum") with your outputs. Here’s how EUTXO enhances the UTXO model:
Conclusion
The UTXO model in Cardano is essential for managing transactions securely and efficiently. It allows users to track their balances through unspent outputs, prevents double-spending, and ensures that each transaction is clear and verifiable.
While EUTXO is like having those bills with extra notes attached that tell you how to use them. This added functionality in EUTXO allows Cardano to support complex applications and smart contracts, making it a powerful platform for developers.
By understanding how UTXOs work, you can better navigate the Cardano blockchain and appreciate its design and functionality.