UTXO Model vs Account Model - Part 1
September 25th, 2023

Welcome back to another installment of Crypto Corner! Get ready to buckle your seatbelts, as this installment will be part one in a two part series where we'll be bringing it back to the basics of blockchains and discussing how blockchains update the state of their public ledger. Blockchains can update their state through a variety of models, but the two most prominent models used today are the UTXO model and the Account model. The UTXO model is utilized by Bitcoin and a variety of older cryptocurrencies (mainly PoW coins), while the Account model is utilized by Ethereum and many other smart contract networks. But before we can discuss how these models update state, let's first define what state even is. In general terms, a system or network can be described as stateful if it is configured to remember or log preceding events or user interactions. This retained information is defined as the state of the system. So applied to a blockchain, state would be the most up to date list of user balances. Given that one of the main appeals of blockchains is the immutable, public ledger that anyone can access, blockchains make for an excellent choice as a stateful system.

Additionally, although blockchains can diverge in how they choose to update state, all blockchains function similarly from an operational perspective when updating state:

  • Transactions are broadcasted to the network and grouped into blocks

  • When blocks are recorded (i.e., appended to the blockchain), the network updates to the new state based on the transactions within the new block

Now with that foundation laid out, we can dive into the two models mentioned above. For part one of this series, we'll be exploring the UTXO model. The Account model will follow as part two in the next installment.

UTXO Model (Unspent Transaction Output)

In the most simplest terms, the UTXO model ensures that for every transaction, the total inputs used to create a transaction equal the total outputs of the same transaction. A UTXO is defined as a representation of a certain amount of cryptocurrency that has been authorized by the sender and is available to be spent by the recipient. To translate that definition to English, UTXOs are funds that are the result of a previous transaction that the holder now has the ability to spend in a subsequent transaction.

To give a real world analogy, UTXOs can be considered similar to cash. For example, say someone holds $100 of cash. That $100 balance could consist of a single $100 bill, five $20 bills, one hundred $1 bills or many other combinations. Similar for UTXOs, someone could have a balance of 100 BTC that is comprised of a single UTXO worth 100 BTC, two UTXOs each worth 50 BTC, one UTXO worth 31.9 BTC and one UTXO worth 68.1 BTC, or an infinite amount of other combinations. However, as you might have noticed, one difference between cash and UTXOs is that while cash is limited to the denominations in circulation, UTXOs can be worth any denomination, not just 1 BTC, 5 BTC, 100 BTC, etc.

Another similarity between cash and UTXOs is that they are unable to be spent piecemeal, they must be spent as a whole. This is because UTXOs can only be spent once. To help illustrate that property, imagine you are buying a $74 steak. You go to pay with a $100 bill and give the cashier the entire $100 bill, not just 74/100ths of it. The cashier will then give you back ~$26 in change minus any taxes. The same is true for UTXOs - if you have a balance of 100 BTC that is a single UTXO and want to send someone 74 BTC, the network would essentially destroy the 100 BTC UTXO that serves as the transaction's single input and create three outputs that equal 100 BTC:

  1. A new 74 BTC UTXO sent to the recipient's address

  2. A new 25.9 BTC UTXO sent back to your address (think of this as the transaction's change)

  3. A new 0.1 BTC UTXO that servers as the transaction fee paid to the Bitcoin miners (this fee will vary based on network congestion, it's just here for illustrative purposes)

Additionally, for those that have only ever used an Account model blockchain (like Ethereum), you might be surprised to learn that the UTXO model does not incorporate accounts or wallets at the protocol level. The UTXO model is entirely based on individual transactions and determining who has control of which UTXOs. However, what may be confusing is many Bitcoin-specific consumer facing products brand themselves as 'wallets'. What is actually happening under the hood is that your single balance of BTC in your 'wallet' is most likely composed of many separate UTXOs spread across different addresses, as it is common practice to use a new address each time a new UTXO is created as a result of a transaction. To help clarify this, we'll build upon the 100 BTC example above. Let's say the single UTXO worth 100 BTC is held at address 123ABC. Once the input UTXO is spent and removed, the 74 BTC UTXO is sent to the recipient's address 123DEF and the 25.9 BTC UTXO is sent back to the originator at a new address 123GHJ. In addition, the originator also controls another UTXO worth 10 BTC at address 123XYZ. In this case, the originator's total BTC balance is 35.9 BTC, which is spread across two separate UTXOs at two different addresses.

Lastly, due to the properties of the UTXO model described above, the history of a UTXO (i.e., how transactions updated the value and owner of a UTXO) is only included in the blocks where it was transferred. This helps minimize the size requirement for each block compared to the Account model, as only the state of certain UTXOs are being updated and not the balance of every address on the network. Due to this, a user's balance is calculated on the client-side by adding up all the available UTXOs controlled by the user.

Phew that was a lot! Congrats if you made it this far and learned more about the UTXO model than you ever thought possible. As mentioned above, next installment will examine the Account model which may be an easier read if you have experience transacting on Ethereum. Below are a few additional resources re: UTXOs for those brave enough for more.

Until next time!

Subscribe to Crypto Corner
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.
More from Crypto Corner

Skeleton

Skeleton

Skeleton