TL;DR: Blockchains manage transactions using two primary models: the UTXO (Unspent Transaction Output) and the Account model, each with distinct properties. The UTXO model, used by Bitcoin, treats transactions like cash, creating and destroying outputs, which is ideal for parallel processing and high fungibility. The Account model, used by Ethereum, functions like a ledger, simplifying smart contract execution and balance management. Quai Network leverages both models: Qi using UTXO for efficient, cash-like transactions, and Quai using the Account model for smart contracts, creating a versatile, decentralized ecosystem for global transactions.
Blockchains have evolved immensely since Bitcoin hit the scene in 2008. Since then, innovations have expanded the utility of blockchains beyond what Bitcoin initially provided. However, most people are often caught off-guard when switching between blockchains when they encounter differences in how they manage transactions.
When engineering blockchains, developers are typically presented with the choice of adopting the UTXO (Unspent Transaction Output) model or the Account model for managing transactions and recording states. Both models have a unique approach which results in varying characteristics and applications. This is especially true when managing token ownership and executing transactions.
The UTXO Model: Like Cash
The UTXO model was first introduced by Bitcoin and is often compared to handling physical cash. A UTXO, or Unspent Transaction Output, is a unique and discrete chunk of cryptocurrency much like the individual bills or coins you might use when handing over cash to pay for goods at a retail store. In the UTXO model, when a transaction occurs existing UTXOs are consumed (or “destroyed”) and new UTXOs are created. This mechanism is essential to prevent double spending as it ensures every UTXO is entirely spent or “destroyed” and prevents unauthorized alteration to the ledger.
An Example of the UTXO Model:
Imagine Alice has 2 UTXOs in her wallet that total 5 BTC in value, but worth 3 and 2 BTC respectively.
If Alice wants to send 4 BTC to Bob, her wallet would consume the two UTXOs to create two new UTXOs, one worth 4 BTC for Bob and the other worth 1 BTC as change back to Alice. The original UTXOs are destroyed in this process and new ones are created to support and settle the transaction.
Unique Properties of the UTXO Model:
Structure
The creation and destruction of UTXOs form a Directed Acyclic Graph (DAG), where each UTXO links back to its predecessor, eventually tracing back to the original coinbase where the coin was minted.
Parallel Processing
The uniqueness of each UTXO makes them ideal for parallel transaction processing as non-overlapping transactions can be processed simultaneously without conflict.
Fungibility
UTXOs offer high fungibility with fixed denominations demonstrating cash-like properties. However, this makes programmability extremely limited. Depending on the application this could be a benefit or an obstacle to overcome.
The Account Model: Like a Ledger
The Account model is one that’s been adopted by the popular Ethereum blockchain and functions similarly to a bank. In the Account model, each account or wallet has a balance and transactions on the blockchain update these balances. This model is more intuitive for implementing smart contracts and supports more complex programming functionality since it doesn’t require creating and destroying discrete units for every transaction.
An Example of Account Model:
In this example Alice has an Ethereum account with a balance of 10 ETH.
If Alice wants to send 4 ETH to Bob the transaction on Ethereum simply reduces Alice’s account balance by 4 ETH and increases Bob’s account balance by 4 ETH. No discrete UTXOs are involved, it’s simply a balance update on both accounts.
Unique Properties of Account Model:
Structure
In the Account model there is a global ledger that records all account balances. Transactions update the balance of one or more accounts, debiting one account and crediting another without the need to manage individual transaction outputs.
Smart Contracts
The Account model is more flexible than UTXOs for implementing smart contracts and complex transactions as it allows easy updating of states and balances without the additional computation in managing individual outputs.
Scalability
While the ledger-like Account model simplifies programmability, it can be less efficient in parallel processing compared to the UTXO model.
How Quai Network Utilizes Both UTXO and Account Models
Due to the unique properties of each model and how they serve a variety of use cases, both UTXO and Account models have a special place in Quai Network’s blockchain implementation. Quai Network uses both models, each with their own native token, in order to provide a complete ecosystem for serving a global, decentralized peer-to-peer economy.
The Quai Network Tokens:
Qi
Qi (/chee/) implements the UTXO model to maintain high fungibility and efficiency. This will make Qi suitable for cross-chain transactions and its cash-like functionality enables secure and straightforward value transfers with high parallelization capabilities. This makes Qi the high-velocity token in a Quai Network economy and the preferred token for simple transactions like purchasing coffee or paying a friend for dinner.
Quai
Quai (/kuuai/) uses the Account model to enable smart contracts similar to Ethereum on the Quai Network. This allows for more complex transactions, easy balance management, and the flexibility required by innovative smart contracts. This makes Quai the programmable money suitable for a wide range of decentralized applications such as exchanges, NFTs, or lending.
The Quai Network has adopted both models to maximize utility for end users and developers alike. To learn more about Quai Network, it’s two token system, and how we’re revolutionizing blockchains, you can follow me on twitter: @mechanikalk or @quainetwork #quai