UTXO vs. Account Models (2024)

Previous Section Recap
In the previous section, we looked at [peer-to-peer network architecture](), one of the main functional pillars of a decentralized distributed network like Bitcoin and [Ethereum](). The traditional "web2" model, typically relies on server-based network architecture.
Server-basedPeer-to-peer (p2p)
Centralized, clients send a request, central server responds backEvery node holds a copy of ledger, any node can read/write it under the right conditions (meets consensus rules)
Developers and applications can be de-platformed (look up what happened to Zynga at Facebook!). Data integrity is vulnerable since server owner can manipulate at whimData integrity is protected by consensus rules. Everyone keeps copy of ledger, no central location.Very good privacy if user uses a new address per tx
Limits innovationPermissionless innovation

Nodes in a blockchain peer-to-peer network, like Bitcoin, can leave and re-enter the network at will. Bitcoin has nodes including full nodes and light nodes.

  • full node: contains entire blockchain file.

  • light node: does not require full blockchain file download, communicates with a full node to allow for lightweight clients to work (ie. wallets)


With traditional web2 server-based platforms, keeping track of user data and information is actually a lot easier than it is on the blockchain. This is because there is a single centralized server that stores the state of user accounts. There's no need for consensus or resolving discrepancies since there's only one central place that stores information.

However, when you move to a decentralized system, the problem of storing user balances becomes tricky. Decentralized networks like Bitcoin and Ethereum need specific models for keeping track of the state of users. Bitcoin uses the UTXO model to keep track of user balances. Ethereum and other EVM chains use the account model to keep track of user balances. Let's dig in further...

📘

What does UTXO mean?

UTXO stands for Unspent Transaction Output. You will see the term UTXO used a bit in this lesson! Bitcoin uses the UTXO model, so we like to include it because it helps us understand tradeoffs in blockchain storage models as well as it will help us compare and contrast to Ethereum and its use of the Account model.

You thought we would already be learning Solidity, huh? Ah well, we are starting from scratch and digging into the fundamentals of what makes blockchains tick. It is important to understand these concepts as they will make you a better-rounded smart contract engineer. Let's dig in...

The best place to start, before looking at how blockchains keep track of user balances, is the place where user balances begin: the transaction. Let's explore with the following questions:

What do we need in a transaction?

Three main things:

  1. amount: the amount to send to someone
  2. payer: the person sending the transfer amount
  3. payee: the person receiving the transfer amount

Since we are working in systems based on really secure cryptography, we need ONE more thing to complete everything required for a successful blockchain transaction:

  1. payer authorization: some sort of unfakeable authorization given by the initiator of the transaction

This fourth item would just end up being the digital signature which is basically a hash that is extremely hard to replicate if you do not have the correct inputs - in this case, a user's private keys. Without the private keys, a payment authorization cannot occur. The only way to do it would be to "hack" basic cryptography which is practically impossible.

What is the purpose of a transaction?

To change some user state! If Alice sends Bob 5 $DAI, Alice's $DAI balance should go -5, Bob's should go +5. Alice's transaction is responsible for changing the state of their balances. Changing state is extremely important in blockchains (which are typically transaction-based networks!), so keep this in mind!

Bitcoin, Ethereum, and regular banks rely on transaction-based models to keep track of user balances. Let's take a further look below...

Account-based Model

If you have a bank account, you are very familiar with this model of keeping track of user balances. The account model follows just that: accounts. It tracks the balances of users based on their overall account state, without any tracking on what constitutes the actual balance itself. In other words, an account-based ledger would mark an entry like this:

Acct #12345 -> Name: Rick Sanchez -> Balance: $142.62

Notice how the state of the account is kept very high level? Rick's account balance is a dollar and cent amount and that's it. There is no further information tracked on what the breakdown of the balance is, for example: $142.62 is one $100 bill, one $20 bill, two $10 bills, eight quarters, five dimes, two nickels, two pennies. When Rick goes to an ATM and withdraws from his balance, he gets it in whatever bills + change the bank has at hand - not in the exact change it took to make up that balance in the first place.

What does a transaction look like in an account-based model?

  1. Alice has $60 total balance.
  2. Bob has $20 total balance.
  3. Bob sends Alice $5.
  4. Bob's balance is subtracted $5, if the remaining balance is greater than 0, proceed, else revert
  5. Alice balance is summed at $5
  6. The ledger is marked on both ends to update total balances and that is the end of the transaction in an account-based model.

This might seem weird. Why would we want to keep track of these details for something as simple as a total balance? We'll look at a model for keeping user balances that does include this feature: the UTXO model.

UTXO-based Model

Ethereum uses the account-based model, while Bitcoin uses UTXOs (short for Unspent Transaction Outputs) to keep track of user state/balances.

The UTXO model differs pretty drastically from the account model. It's a little bit more complex - mainly because it is not a familiar interface like the account model is! Yet it does set up some interesting features...

What is a UTXO? 🤔

Alice sends Bob 5 BTC in the form of a transaction relayed to the Bitcoin network. At this point, if the transaction is valid (Alice has > 5 BTC, Alice owns the relevant private keys and can produce a signature, etc), Alice is signaling an intent to change user state. When the Bitcoin network mines Alice's transaction, Bob is credited with a UTXO worth 5 BTC.

This is how the Bitcoin network keeps track of user balances - it keeps a really big long set of UTXOs - outputs out-of-state-changing transactions that credit users with a certain amount of BTC. So when people say: "I own 3 bitcoins", they should really be saying: "I own some UTXOs that allow me to spend 3 bitcoins." - or using the Drake meme:

UTXO vs. Account Models (1)

Important notes on UTXOs:

  1. All UTXOs are non-fungible (fun fact: the first NFT collection ever was... Bitcoin!)
  2. To spend a UTXO, you must refer back to that specific UTXO.

A user's UTXOs are scattered across blocks.

  1. Once a UTXO is "consumed", any leftover change from the transaction creates new UTXOs representing the change amounts
  2. A UTXO, often referred to as a "coin", can only be spent ONCE. No double-spending!
  3. In Bitcoin, each UTXO has a script associated with it

📘

Scripts are basically hard-programmed code that each UTXO stores. They usually contain the conditions under which to unlock the UTXO for further spending. More resources on Bitcoin Script.

Account vs UTXO model

AccountsUTXOs
User BalancesOverall Account State (ie. Alice has 4.2 ETH)Specific UTXOs (ie. Alice has 29 UTXOs that amount to 2.65 BTC)
ProsMore intuitive, easier to quickly understandVery good privacy if the user uses a new address per tx
ConsReplay Attacks (someone could re-)UTXOs are stateless, which complicates state-heavy designs

Conclusion

Deciding what model to go with is a game of design tradeoffs. Ethereum's account-based transactions must be more flexible to account for the many moving pieces of state in the system. Bitcoin uses UTXOs as it is a network purposefully designed to be as simple and stateless as possible.

Alchemy University offers free web3 development bootcamps that explain more about blockchain accounts and help developers master the fundamentals of web3 technology. Sign up for free, and start building today!

Updated about 1 year ago

UTXO vs. Account Models (2024)

FAQs

UTXO vs. Account Models? ›

The conceptual difference is that the account model updates user balances globally. The UTXO model only records transaction receipts. In the UTXO model, account balances are calculated on the client-side by adding up the available unspent transaction outputs (UTXOs).

What is the alternative to UTXO? ›

Using Lightning Network as an Alternative to UTXO Management

Transacting on the Lightning Network can be an alternative to UTXO management for small transactions. However, you still have to pay the on-chain transaction fee for transferring the bitcoin into or from a lightning channel.

What is the difference between Bitcoin UTXO and Ethereum account? ›

Ethereum uses the account-based model, while Bitcoin uses UTXOs (short for Unspent Transaction Outputs ) to keep track of user state/balances. The UTXO model differs pretty drastically from the account model. It's a little bit more complex - mainly because it is not a familiar interface like the account model is!

Why is UTXO better? ›

There are many key advantages to using the UTXO model: Parallelism for Transactions: Transactions move funds owned by a single user, so transactions issued by different users consume completely different outputs. Such transactions can be processed in parallel, enabling faster and more efficient transaction validation.

What are the disadvantages of UTXO? ›

Disadvantages of UTXO:
  • Less user-friendly: Transactions can be more complex with multiple UTXOs involved, compared to the simpler account-based system.
  • Limited programmability: Standard UTXOs don't support complex smart contracts, although newer variations like Nervos' "cell model" aim to address this.
Feb 25, 2024

What is the difference between account model and UTXO? ›

The conceptual difference is that the account model updates user balances globally. The UTXO model only records transaction receipts. In the UTXO model, account balances are calculated on the client-side by adding up the available unspent transaction outputs (UTXOs).

What the heck is UTXO? ›

An unspent transaction output (UTXO) is the amount of digital currency that remains after a cryptocurrency transaction.

Is Cardano a UTXO or account? ›

Cardano (like Bitcoin) is an Unspent Transaction Output (UTXO)-based blockchain, which utilizes a different accounting model for its ledger from other account-based blockchains like Ethereum.

Is Solana UTXO based? ›

One distinguishing feature of Solana's architecture is its use of the UTXO (Unspent Transaction Output) model.

What blockchains are based on UTXO? ›

Accordingly, the UTXO model is a way of organizing a blockchain's ledger such that no funds are spent twice, avoiding the double spending problem. Once a UTXO is spent, one (or more) new UTXO are created as a result of that transaction.

What is a UTXO for dummies? ›

UTXOs are the unspent outputs of previous transactions. They represent the cryptocurrency that a user possesses and can use in future transactions. UTXOs can only be created with coinbase transactions. Coinbase transactions occur when a new block is mined, creating new UTXOs iwthout prior inputs.

What is an example of a UTXO model? ›

Let us describe with an example how the UTXO model works: Anna has 1 Bitcoin in her wallet and wants to transfer 0.4 BTC to Beatrice; the transaction will not move the exact amount, but will have as input 1 BTC, which will then be divided into 0.4 Bitcoin to be sent to Beatrice and 0.6 to be returned to Anna.

Which cryptocurrencies use UTXO? ›

The UTXO model is a fundamental element of Bitcoin and many other cryptocurrencies. In other words, cryptocurrency transactions are made of inputs and outputs. Anytime a transaction is made, a user takes one or more UTXOs to serve as the input(s).

How does UTXO prevent double-spending? ›

Here's how UTXO helps prevent double-spending:

Unique identifiers: Each UTXO has a unique identifier (transaction ID and output index), making it easily traceable. One-time use: Once a UTXO is used as an input in a transaction, it's marked as spent and cannot be used again.

What are the benefits of using UTXO style for online transaction model? ›

The UTXO model is an essential component of blockchain technology that ensures transaction integrity by preventing double-spending. By keeping track of all the unspent transaction outputs, the UTXO model ensures that each cryptocurrency unit can only be spent once and cannot be used in any fraudulent activities.

How does Bitcoin use UTXO Ethereum uses? ›

UTXO and Account Balance Models are two different ways to track funds and transactions; Bitcoin uses UTXO, while Ethereum uses the Account Balance Model. Bitcoin is based on the UTXO blockchain model where a transaction is divided into different parts – inputs and outputs.

What is the difference between UTXO and Eutxo? ›

The EUTXO model extends the UTXO model in two ways: It generalizes the concept of 'address' by using the lock-and-key analogy. Instead of restricting locks to public keys and keys to signatures, addresses in the EUTXO model can contain arbitrary logic in the form of scripts.

What is the alternative to Blockchair? ›

Filter your search
  • Etherscan. Free CustomersBlock Explorers. ...
  • Enterprise CustomersBlock Explorers. The onchain explorer.
  • Ethernow.xyz. Block Explorers. ...
  • Blockscout. Free CustomersBlock Explorers. ...
  • Sepolia Testnet Explorer. Block Explorers. ...
  • Ethplorer. Block Explorers. ...
  • Chainlens. Block Explorers. ...
  • Etherchain. Block Explorers.

What is the alternative to Mempool space? ›

Alternatives to Mempool
  • Blockdaemon. Blockdaemon. 2 Ratings. ...
  • Bitcoin Explorer. Bitcoin Explorer. This self-hosted explorer is for the Bitcoin blockchain. ...
  • Crystal Blockchain. Crystal Blockchain. ...
  • BTC.com. BTC.com. ...
  • KYCP. KYCP. ...
  • Solana Beach. Staking Facilities. ...
  • Mintscan. Cosmostation. ...
  • Blockstream Explorer. Blockstream.

What is the difference between address and UTXO? ›

There are only UTXOs or unspent coins designated to different wallet addresses. The critical point is that the Bitcoin protocol doesn't track users' balances but rather individual coins represented as UTXOs which are attributed to different addresses. Check the UTXO model explained article to learn more about this.

Top Articles
Decentralized Finance (DeFi) - An Introduction (with Examples) | Brave
Blog Post - American Numismatic Association
Foxy Roxxie Coomer
Shs Games 1V1 Lol
Polyhaven Hdri
Toyota gebraucht kaufen in tacoma_ - AutoScout24
2013 Chevy Cruze Coolant Hose Diagram
Elle Daily Horoscope Virgo
Sams Gas Price Fairview Heights Il
Detroit Lions 50 50
What Is Njvpdi
Sand Castle Parents Guide
What is Cyber Big Game Hunting? - CrowdStrike
Paradise leaked: An analysis of offshore data leaks
Q Management Inc
Fdny Business
Locate At&T Store Near Me
Salem Oregon Costco Gas Prices
Vistatech Quadcopter Drone With Camera Reviews
Ibukunore
Jang Urdu Today
Espn Horse Racing Results
Qual o significado log out?
Gas Buddy Prices Near Me Zip Code
Riversweeps Admin Login
Weve Got You Surrounded Meme
Giantbodybuilder.com
Bayard Martensen
Rgb Bird Flop
Turns As A Jetliner Crossword Clue
Past Weather by Zip Code - Data Table
FSA Award Package
Boneyard Barbers
Whas Golf Card
Prima Healthcare Columbiana Ohio
John F Slater Funeral Home Brentwood
Bimar Produkte Test & Vergleich 09/2024 » GUT bis SEHR GUT
Ktbs Payroll Login
Unifi Vlan Only Network
How To Upgrade Stamina In Blox Fruits
Infinite Campus Farmingdale
Wilson Tattoo Shops
Panorama Charter Portal
Go Bananas Wareham Ma
John M. Oakey & Son Funeral Home And Crematory Obituaries
Po Box 101584 Nashville Tn
What Is The Optavia Diet—And How Does It Work?
Tlc Africa Deaths 2021
Gary Vandenheuvel Net Worth
Unblocked Games - Gun Mayhem
Fine Taladorian Cheese Platter
Urban Airship Acquires Accengage, Extending Its Worldwide Leadership With Unmatched Presence Across Europe
Latest Posts
Article information

Author: Delena Feil

Last Updated:

Views: 6173

Rating: 4.4 / 5 (45 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Delena Feil

Birthday: 1998-08-29

Address: 747 Lubowitz Run, Sidmouth, HI 90646-5543

Phone: +99513241752844

Job: Design Supervisor

Hobby: Digital arts, Lacemaking, Air sports, Running, Scouting, Shooting, Puzzles

Introduction: My name is Delena Feil, I am a clean, splendid, calm, fancy, jolly, bright, faithful person who loves writing and wants to share my knowledge and understanding with you.