UTXO and Account Based Chains

Berat Alptegin Karaca
Coinmonks
5 min readAug 17, 2023

--

What is “UTXO” ?

UTXO stands for “Unspent Transaction Output” which we may refer to as an accounting method for clarity.

A UTXO chain can be described as a blockchain utilizing the UTXO accounting method.
(Example: Bitcoin, Litecoin)

In UTXO chains, there are no accounts or wallets at the protocol level. Instead, funds are stored as a list of UTXOs.

The term “unspent transaction output” represents an output received by a transaction that the user can spend in the future, hence remaining “unspent.”

Under this model, transactions are created by consuming existing UTXOs and generating new ones in their place. UTXOs can be divided or combined to achieve the required value in a specific transaction.

This concept can be explained by likening it to cash money.

How does it work?

Each UTXO can be likened to a banknote or coin.

If you have 100 Turkish Lira in cash, you may have one of the following combinations:

  • Two 50 lira banknotes
  • Five 5 TL banknotes and three 25 TL banknotes
  • Twenty 2 TL coins and six 10 TL banknotes
  • and so on. Examples can be multiplied.

In these examples, despite having different numbers of banknotes and coins, you have exactly 100 TL.

UTXOs behave the same way; when you see a single balance in your crypto wallet, it could consist of any number of UTXOs based on your past transaction history. Together, these UTXOs make up the total balance at your specific wallet address.

UTXO Models and the Concept of “Change”

Just like cash, UTXOs are indivisible.

Imagine wanting to buy a coffee for 47.5 TL. If you only have five 10 TL banknotes, you must overpay (by giving 50 TL) and get change. In this case, you need to receive 2.5 TL in change.

UTXOs behave in a similar way. Just as you cannot tear off a piece of your 10 TL banknote for your coffee, you cannot send “part” of a UTXO.

If you wish to send someone 2.50 BTC, but have a UTXO worth 10 BTC in your wallet, you must send the entire UTXO to the recipient and then receive change. Of course, this process is managed by the blockchain protocol, and you don’t have to trust the recipient to give back your change. Therefore, when you make this transfer, the recipient receives 2.5 BTC, and the remaining 7.5 is sent back to your address as a new, smaller UTXO, as “change.” (transaction fees are excluded in this example)

If you want to send someone 1.2 BTC, the path to follow is the same. You must send two UTXOs (like giving two 10 TL banknotes); one is fully consumed, and the other requires you to receive change as a new UTXO.

Do UTXOs Work Exactly Like Cash?

Although the analogy “UTXOs are like cash” is helpful to understand the basic concept, there are a few areas where the analogy does not hold true.

When buying something with cash, you typically pay a specific amount and receive the remaining change. For example, if you have a 50 TL banknote and are buying a 37.5 TL coffee, you pay the full 50 TL and receive 12.5 TL in change. In this case, there is no “transaction fee” either.

However, when making a transaction in the UTXO model, you may need to pay a fee to execute the transaction. This serves as an incentive for miners to include your transaction in the blockchain. This is where the difference between cash and UTXOs emerges.

EXAMPLE

If you have a 10 BTC UTXO and want to send 3.75 BTC, suppose you must pay a transaction fee of 0.25 BTC. In this case, you send 3.75 BTC to the recipient and receive 6.00 BTC in “change.”

The transaction fee is deducted from your total 10 BTC, so you cannot receive exactly 6.25 BTC in change.

To summarize, since you generally have to pay a transaction fee in blockchain transactions, this fee is deducted from the “change,” making UTXOs different from cash.

There is no such transaction fee in cash, so you receive the entire amount paid and the remaining amount as change.

Secondly, official banknotes and coins have a fixed value. When paying for coffee, you cannot receive a banknote worth 6.25 dollars. In contrast, UTXOs can be of any amount.

Account-Based Chains

What is an Account-Based Chain?

Unlike UTXO chains, where coins are uniquely referenced, account-based chains (such as the Ethereum and Binance Smart Chain) feature an accounting model where balances are kept at each address. In this model, the account balance is updated directly, rather than by adding or subtracting individual UTXOs.

How Do Account-Based Chains Work?

Transactions in an account-based chain consume gas (transaction fees), and the sender’s balance decreases by the total amount of the transferred value plus the gas fee. The recipient’s balance increases by the amount of the transferred value.

EXAMPLE

If you want to send 47.5 ETH from address A to address B, and the transaction fee is 0.005 ETH, then:

  • Address A’s balance decreases by 47.505 ETH (47.5 + 0.005)
  • Address B’s balance increases by 47.5 ETH

The remaining 0.005 ETH (the transaction fee) is awarded to the miner who successfully mines the block containing this transaction.

The operation is more straightforward than the UTXO model.

You simply deduct the transfer amount plus the gas fee from the sender’s balance and add the transferred value to the recipient’s balance.

Comparison: Which one is “better” ?

The UTXO and account-based models differ in many respects.

Some significant differences include:

  1. Transaction Structure: In UTXO chains, the transaction structure is complex due to the utilization of unspent outputs, whereas account-based chains feature a simpler transaction structure.
  2. Scalability and Privacy: UTXO chains generally provide better privacy, but the account-based chains are considered more scalable.
  3. Programming Flexibility: Account-based chains, like Ethereum, typically offer more extensive programming capabilities, enabling developers to create more complex applications such as smart contracts.

In conclusion, both the UTXO and account-based models serve as different means to manage blockchain transactions, each having unique features and benefits.

Depending on the specific application or preference, one model may be chosen over the other. So I don’t think that we can say one is better than the other, it depends.

--

--