Both the UTXO (unspent transaction output) and accounts models are methods of cryptocurrency record-keeping used to represent the number of tokens someone has remaining after executing a transaction on the blockchain. These models are a key method in which blockchain architecture maintains an accurate ledger while ensuring privacy.
What Is the UTXO Model?
The easiest analogy for UTXOs is physical fiat currency. Just like how coins or notes cannot be split into smaller denominations, a UTXO cannot be divided either. One can think of a UTXO as a discrete (indivisible and unique) chunk of its corresponding token controlled by the private key of its owner.
The UTXO model is used by projects such as Bitcoin (BTC), Bitcoin Cash (BCH), Litecoin (LTC), and Zcash (ZEC) among others. The collection of all existing UTXOs at any given point is called the UTXO set. Any transaction performed on the blockchain can be viewed as a modification of the UTXO set.
How Does a UTXO Transaction Work?
UTXO model blockchains execute transactions by using UTXOs generated by previous transactions as an input, then receive UTXOs generated by the new transaction as an output. Transactions under the UTXO model can be understood through the following example:
- Bob has three $20 notes. Each note represents a single UTXO. They cannot be exchanged for smaller denominations without first being “consumed.”For example, to exchange a $20 note for two $10 notes, Bob must consume the UTXO representing $20 for two UXOs representing $10 each.
- Bob wants to pay Alice $35.
- Bob hands Alice two $20 notes, then receives one $5 note in return.
- A total of two UTXOs were generated in this transaction. The first represents the two $20 notes given to Alice, while the second the $5 in change given back to Bob.
Unlike physical currency, a single UTXO could represent 5 BTC, 479.2 BTC, or anything in between. The tokens held in a user’s wallet represent the total amount of UTXOs under their ownership. Moving onto the blockchain, let’s instead consider what would happen if Bob wanted to send Alice 3.7 BTC:
- Similar to the banknotesfrom the example earlier, Bob’s wallet contains a total of three UTXOs, valued at 3 BTC, 0.8 BTC, and 0.6 BTC respectively. These UTXOs will be used as the input for this transaction, and were themselves output from a previous transaction.
- As Bob does not have enough BTC in a single UTXO to cover the transaction, he sends both the 3 BTC and 0.8 BTC UTXOs to Alice, representing a total of 3.8 BTC.
- The two UTXOs are consumed. Alice’s wallet receives a new UTXO of 3.7 BTC, while Bob’s wallet receives a new UTXO with the remaining 0.1 BTC.
Visual representation of a UTXO model transaction (Source: SEBA Bank Research)
What Is the Account Model?
The easiest analogy for the account model is a debit card or bank account. Unlike physical fiat currency that cannot be split into smaller denominations, an account model supports the credit (or debit) of any arbitrary amount of the token. While UTXO wallets represent the total sum of a user’s UTXOs, an account model wallet simply represents the user’s aggregate balance.
The account model is used by projects such as Ethereum (ETH), Ethereum Classic (ETC), and Ripple (XRP) among others. Unlike the UTXO model, transactions represent a single transfer of funds between accounts, and no additional inputs or outputs are necessary. All that’s required is a change on the ledger.
How Does an Account Model Transaction Work?
The balance of each account is stored on the blockchain. Account model blockchains execute transactions simply by reducing the balance of one account, then increasing the balance of the recipient by the corresponding amount. Let’s see how the previous example would differ if Bob instead wanted to send Alice 3.7 ETH.
- Bob’s wallet contains a single balance of 4.4 ETH.
- As Bob’s wallet is a singular balance, he can directly transfer 3.7 ETH to Alice.
- The 3.7 ETH is deducted from Bob’s wallet and added to Alice’s wallet.
Visual representation of an account model transaction (Source: SEBA Bank Research)
What Are the Differences Between the UTXO and Account Models?
While both the UTXO and account models serve the same goal of keeping record of wallet balances in a blockchain network, they each come with a distinct set of advantages and disadvantages:
- Scalability: As storing a single balance requires significantly less memory than storing all the UTXOs owned by that user, the account model utilizes memory in a more efficient manner. Transactions in the account model are also smaller as they only require the sender, recipient, amount, and digital signature. Each Ethereum transaction is around 100 bytes in size, while a UTXO model transaction is typically several times larger.On the other hand, the verification mechanisms inherent in the UTXO model make the design more suitable for the development of payment channels such as the Lightning Network. The parallelizable nature of UTXO transactions also makes it easier to partition UTXO-based blockchains into shards and sidechains.The UTXO model enables the aggregation and definition of outputs on the client side, which reduces network computation requirements. Account models are more demanding, as every node needs to localize both sender and recipient accounts across different shards.
- Privacy: The UTXO model makes switching between addresses trivial, meaning it becomes more difficult to track the ownership of coins. Newly generated addresses do not have a public owner, and advanced chain analysis is typically required to link them to a specific user. As the accounts model encourages the reuse of a single address, such blockchains make it much easier to identify a transaction history.On the other hand, the account model offers better privacy in terms of fungibility. When considering the UTXO example from earlier, it becomes trivial for any third party to deduce that the 3.7 BTC UTXO in Alice’s wallet was generated from Bob’s 3 BTC and 0.8 BTC UTXOs. No such connection can be made from the accounts model as any wallet funded with multiple transactions is still represented by a single balance. Should Alice ever spend ETH from her wallet, no one would be able to tell if that ETH had come from Bob or someone else.
- Smart Contract Functionality: The simplified and intuitive nature of accounts-based transactions gives the model significant advantages in terms of smart contract functionality. Verifying a singular balance is less computationally demanding than calculating UTXO input/output logic, and makes it easier for decentralized app (DApp) developers to program multi-party contracts and transactions.As an example, the Ethereum Virtual Machine (EVM) can handle transactions between multiple smart contracts simply by adjusting their respective balances. The UTXO model is much more resource-intensive as it requires explicit UTXO inputs and outputs across each transaction. Smart contracts programmed in a UTXO model have to consider the number of inputs to combine, or which inputs should be combined in the case of multiple options.
- Security: In UTXO blockchains such as Bitcoin, validator nodes keep track of the UTXO set to determine exactly which coins are in circulation, along with who has ownership over them. As each transaction must reference the exact UTXOs being spent, the system solves the double-spend problem in a trustless and efficient manner. Account model blockchains have proven far more vulnerable, and are often plagued with other issues such as chargebacks and overdrawn smart contracts.Instead of the clearly defined inputs and outputs used by the UTXO model, the account model uses “events” that must be checked for accuracy by a virtual machine. This adds a level of uncertainty to the process as the validity of a transaction is not confirmed until execution. For example, the Ethereum Classic project lost millions in a series of double-spend attacks over the course of 2020.
Both the UTXO and accounts models play a critical role in recording transactions on the blockchain. In the UXTO model, transactions are recorded as a set of (unspent transaction) outputs. In the accounts model, transactions are recorded on a global set of balances.
As both models feature different advantages and drawbacks, their applications in any given blockchain depend largely on what the project is trying to do. Ethereum uses the account model as it focuses is on the deployment of powerful smart contracts, while Bitcoin uses UTXO as it is more concerned with the development of electronic cash.
Newer projects are seeking to further innovate on these models. Cardano (ADA), Tron (TRX), and Qtum (QTUM) among others have sought to combine the advantages of both into advanced hybrid models. These models make it easier for developers to utilize UTXO without giving up the power of smart contracts.
An example is Cardano’s extended UTXO (EUTXO) model, which provides the ability to develop smart contracts while also retaining parallel processing functionality. The model also adds data fields to the outputs of each transaction, which allows information to be linked much in the same way as a smart contract.