Let’s Learn About UTXO and Account Based Models

Smart Contract Audit Token
5 min readMay 14, 2024

If you have been involved in Cardano for any length of time or just started researching it, you have probably heard somewhere that Cardano uses UTXO. And if you are fairly new to crypto, you might be wondering what that even means, what implications it has, and what the alternatives are. I have written this article to try to clear this up for you.

In the contest of blockchain and cryptocurrency transactions, Unspent Transaction Outputs (UTXOs) are a method for managing the state of its ledger (accounting for the transactions that take place). Bitcoin, the first and largest cryptocurrency started with UTXO and then the second biggest alternative, Ethereum, utilizes a different method known as the Account-Based Model. So lets learn the basics for what UTXO is, how they differ from Account-Based, and some examples of both to make sure you understand.

Blockchains that use UTXO

Cardano

Ergo

Bitcoin

Blockchains that use Account-Based

Ethereum

Binance Smart Chain (BSC)

Solana

Avalanche

UTXO (Unspent Transaction Output) Model

Concept:

• In the UTXO model, the blockchain keeps track of individual units of cryptocurrency (UTXOs) that represent the output of transactions.

• Each UTXO corresponds to a specific amount of cryptocurrency and is associated with a particular address.

Transaction Inputs and Outputs:

• When a user wants to send cryptocurrency, they use one or more UTXOs as inputs in a transaction.

• The transaction creates new UTXOs as outputs, representing the newly owned cryptocurrency for the recipient.

Unspent Outputs:

• The term “Unspent Transaction Output” implies that a UTXO has not been used as an input in any transaction.

• The blockchain maintains a record of all unspent UTXOs, forming the current state of the system.

Validation:

• To validate a transaction, the network checks that the sum of inputs is equal to or greater than the sum of outputs.

• This model supports a high level of parallelism, making it efficient for verification.

Example:

• Bitcoin uses the UTXO model. If Alice has received 2 BTC in one transaction and wants to send 1 BTC to Bob, the transaction would consume the 2 BTC UTXO and create two new UTXOs — one with 1 BTC for Bob and another with 1 BTC (change) for Alice.

Account-Based Model

Concept:

• In the account-based model, the blockchain maintains account balances for each user.

• Instead of tracking individual units (UTXOs), the blockchain records the total balance associated with an address.

Transaction Process:

• When a user initiates a transaction, it deducts a certain amount from the sender’s account and adds that amount to the recipient’s account.

• The blockchain maintains a record of account balances as the primary state.

Validation:

• To validate a transaction, the network checks that the sender has a sufficient balance to cover the transaction amount.

• This model may involve more complex validation processes, especially in scenarios with concurrent transactions.

Example:

• Ethereum primarily uses an account-based model. If Alice has 5 ETH and wants to send 2 ETH to Bob, the transaction deducts 2 ETH from Alice’s account and adds 2 ETH to Bob’s account.

Key Differences

Granularity:

• UTXO model operates at the level of individual transaction outputs.

• Account-based model operates at the level of entire account balances.

Parallelism:

• UTXO model supports high parallelism as each UTXO can be independently spent.

• Account-based model may involve more coordination, especially in scenarios with multiple concurrent transactions affecting the same account.

Privacy:

• UTXO model can offer certain privacy advantages as it allows for more fine-grained control over which UTXOs are used in a transaction.

• Account-based model may be more transparent as the entire balance of an account is typically visible.

Complexity:

• UTXO model transactions can be simpler to construct and validate.

• Account-based model transactions may involve more complexity, especially when dealing with complex smart contract interactions.

Both models have their strengths and trade-offs, and the choice between them depends on the design goals and requirements of a particular blockchain platform.

UTXO Model Example (Bitcoin)

Initial State:

• Alice has received two transactions:

1. Transaction 1: 2 BTC

2. Transaction 2: 3 BTC

Transaction Request:

• Alice wants to send 4 BTC to Bob.

Transaction Construction:

1. Alice’s UTXOs:

• UTXO1: 2 BTC (from Transaction 1)

• UTXO2: 3 BTC (from Transaction 2)

2. Transaction Output:

• Bob’s address: 4 BTC

3. Transaction Input (UTXO to be spent):

• UTXO1 (2 BTC) from Transaction 1

4. Change Output (if any):

• Alice’s address: 1 BTC (Change from UTXO2)

Transaction Execution:

• The transaction consumes (spends) UTXO1, meaning that UTXO1 is used as the input to the transaction. It’s essentially saying, “I am spending this 2 BTC UTXO to fulfill the transaction.”

• The transaction then creates (outputs) two new UTXOs:

1. Bob’s UTXO: 4 BTC — This is the amount sent to Bob.

2. Alice’s Change UTXO: 1 BTC — This is the “change” returned to Alice.

Resulting State:

• Alice’s UTXOs:

• UTXO2: 3 BTC

• UTXO3 (Change): 1 BTC

• Bob’s UTXOs:

• UTXO4: 4 BTC

In summary, the transaction consumes (spends) the UTXO1 of 2 BTC, and in return, it creates (outputs) two new UTXOs: one for Bob with 4 BTC and one as change for Alice with 1 BTC. The concept of “change” arises when the value of the spent UTXO is greater than the transaction amount, and the excess is returned to the sender as a new UTXO.

Account-Based Model Example (Ethereum)

Initial State:

• Alice’s Ethereum address has a balance of 10 ETH.

Transaction Request:

• Alice wants to send 3 ETH to Bob.

Transaction Construction:

1. Transaction Output:

• Bob’s address: 3 ETH

2. Transaction Input (Alice’s account balance):

• Alice’s address: 10 ETH

Transaction Execution:

• The transaction deducts 3 ETH from Alice’s balance and adds 3 ETH to Bob’s balance.

Resulting State:

• Alice’s Ethereum address: 7 ETH

• Bob’s Ethereum address: 3 ETH

Notes:

• Account balances are adjusted directly in transactions.

• There is no concept of “change” as in the UTXO model.

These examples illustrate the fundamental differences in how transactions are structured and executed in the UTXO model (Bitcoin) and the account-based model (Ethereum). The UTXO model involves selecting specific UTXOs to spend, while the account-based model directly adjusts account balances. Each model has its advantages and is suited to different use cases and design philosophies

Conclusion

I hope after reading this article and following along with the examples, you now have a better understandings of the different account models and what their implications are.

Want to learn more?

Find out more about Smart Contract Audit Token via:

Twitter

Website

GitHub

Reddit

Discord

DYORTool

Disclaimer

The information in this article and contest is produced for educational and informational purposes only and is not intended to be used as a financial promotion. No information, data, or analysis presented are intended to form the basis of any investment decision. This is not investment advice, solicitation of any kind nor an endorsement. Nothing in this document should be construed as an offer or inducement to engage in any form of investing activity. AUDIT tokens are for governance in our DAO and should be considered as having no monetary value.

--

--

Smart Contract Audit Token

A DAO that performs decentralized smart contract audits completely independent and free from any conflicts of interest. Funded by Project Catalyst.