Loading

wait a moment

Comparing Bitcoin & Ethereum: UTXO vs Account Based Transaction Models

bitcoin social trading

The two most well-known cryptocurrency platforms, Bitcoin and Ethereum, utilize different transaction models for their platforms, each with their own specific advantages and disadvantages over the other. Understanding how they work from a conceptual perspective is important to further understanding of the overall framework of these platforms and other platforms built with the same or similar models.

While consensus in cryptocurrency platforms is necessary to secure the network and validate the state of the blockchain, the transaction model employed by a platform is used to prove ownership over tokens. Bitcoin uses the Unspent Transaction Output (UTXO) scheme while Ethereum uses the Account Based model. Both models are, at their most basic level, models for tracking database state, and the implementation of each in their respective platforms has a specific purpose and role in the larger structure of the platform.

UTXO vs Account Based Models

Bitcoin was the first cryptocurrency and thus the first platform to utilize the more abstract UTXO model, while Ethereum’s Account Based model more fundamentally represents a model similar to the traditional banking account model.

The UTXO Scheme and Its Use in Bitcoin

The unspent transaction output model applied in Bitcoin is a more abstract concept than the account based model used in Ethereum. It is a vital component of Bitcoin that allows for the blockchain to be transparent through all of the transactions being linked by a chain of digital signatures.

What is Nakamoto Consensus

Read: Our Guide to Nakamoto Consensus

In the UTXO model, each token owner transfers a coin they own to another by digitally signing the hash of a previous transaction and the public key (address) of the next owner and adding these to the end of the coin. The mechanism is essentially a continual transgression of inputs and outputs where the owner of tokens actually does not directly own the tokens, but rather owns the output to a specific number of tokens that can then be signed over as an input to a new owner who then controls the new outputs. There are 3 fundamental rules in the UTXO scheme.

  • Every transaction must prove that the sum of its inputs are greater than the sum of its outputs.
  • Every referenced input must be valid and not yet spent.
  • The transaction must have a signature matching the owner of the input for every input.

So, in a typical UTXO transaction, lets use Alice and Bob as an example. Alice owns 10 BTC and wants to send 5 to Bob. Bob does not own any BTC. Instead of outright owning 10 BTC, Alice owns 2 different transaction outputs consisting of 6 and 4 BTC respectively. Alice’s wallet would pick the best output to send to Bob. In this case, the output of 6 BTC would be sent to Bob, and Bob becomes the owner of 5 BTC by having the requisite address, digital signature, and digital key necessary to prove ownership over the new output. The additional 1 BTC of change from the transaction is returned to Alice and is known as the unspent transaction output (UTXO). Now, Alice still owns two outputs, but they are composed of 1 and 4 BTC, respectively. Bob now controls 1 output worth 5 BTC. A payee can verify the signatures to verify the chain of ownership of the tokens on the distributed public ledger. Of note, miners generate Bitcoin through a coinbase transaction, which does not contain any inputs.

UTXO Model

UTXO Model, Image from Bitcoin.org

Logically, the UTXO model is much simpler than the account model in terms of scalability, and critically, it allows the consensus model of Bitcoin (PoW) to remain simple. This has important ramifications for the scalability and security of the network overall. Bitcoin also supports multiple scripting types which allow it to process complex payment logics.

The design of the UTXO model has numerous advantages that make it stand out as an elegantly compatible mechanism within the Bitcoin network architecture. One of the most important advantages of this system is that it allows for Simple Payment Verifications (SPV) on the network. These light wallets can interact with the Bitcoin blockchain in a decentralized and trustless manner without actually having to download the entire Bitcoin blockchain, thus significantly reducing storage and allowing phone applications to interact on the Bitcoin network.

Additionally, the UTXO model creates an environment where parallel processing capacity across multiple addresses is possible, enabling a much better infrastructure for scalability. Transactions can be processed in parallel since they all refer to independent inputs. Finally, if a user generates a new address for each transaction, it becomes more difficult to link accounts despite the transparency of the blockchain. This is the pseudo anonymous property of Bitcoin, however, increasingly prevalent techniques for tracing transactions and linking accounts has led to Bitcoin not being as fungible as initially perceived.

Despite some substantial advantages of the UTXO model in its application into a framework like Bitcoin’s, there are still some key disadvantages, especially when the model is applied to a more complex, Turing complete platform such as Ethereum. For instance, building applications on the UTXO design forces developers to limit the amount of state impacted by each output. Similarly, the UTXO transaction scheme inherently is not compatible with developing smart contracts since the concept is really only suitable for use in applications where each output is only owned by one person and can break down if the output can be consumed by two or more people at the same time.

The Account Based Model and Its Use in Ethereum

Balance management in the Account Based model is the more familiar of the two models and works in Ethereum similar to the way it works in the traditional banking world. Essentially, each account experiences direct value and information transfers with state transitions.

Ethereum Guide

Read: Our Complete Guide to Ethereum

For instance, Alice and Bob want to transact with each other. Alice wants to send Bob 5 tokens and Alice has 10 tokens in her account while Bob has 0. In the account based model, Alice sends Bob 5 tokens which are subtracted from her account and added to Bob’s account. Alice now has 5 tokens and Bob has 5. This is a simple concept and is how the traditional finance model of transactions works since it is easy to track and prevent double spending because there are centralized authorities throughout the financial system monitoring the flow of transactions.

In Ethereum, there are two types of accounts, private key controlled user accounts and contract-code controlled accounts (smart contracts). This is important because it is a vital reason why Ethereum chose the Account based model over the UTXO model. Because Ethereum uses a Turing complete programming language (Solidity) and one of its main features are smart contracts, the account model affords much greater simplicity than the UTXO based model used by Bitcoin. Ethereum has a substantial amount of decentralized applications which contain arbitrary state and code, it does not make sense to employ the UTXO model used in Bitcoin as it would inherently limit the ability of smart contracts to execute.

Every account in Ethereum has its own balance, storage and code-space for calling other accounts or addresses. A transaction is valid if a sending account has enough balance to pay for it. If the receiving account has code, the code runs, changing anything from internal storage to creating additional messages that may have subsequent effects on debits and credits to other accounts. Due to this, every newly generated block can potentially affect the state of all other accounts.

Specific advantages afforded by the account model in Ethereum are larger space saving, simplicity, familiarity, and fungibility. Every transaction in the account model only needs to make one reference and signature that produces one output, contrary to UTXO design. This allows for substantial space savings which is vital to a platform as large and complex as Ethereum. Additionally, besides the familiarity and simplicity enabled by the account based model, there is a much higher degree of fungibility on the Ethereum blockchain than compared to Bitcoin. Users of Ethereum perform transactions using client remote procedure calls which make tracking internal transactions across the Ethereum ledger much more challenging than Bitcoin where all transactions are publicly linkable through the ledger by tracking the digital signatures of the UTXO scheme. Thus, fungibility is increased since merchant blacklisting of coins used for illicit activities is difficult to accomplish.

On the other side, disadvantages of the account model revolve around it limiting scalability of the platform. Although a necessary implementation due to Ethereum’s design, scalability issues surrounding Ethereum’s development are well established and a concern that has come to the forefront of the broader industry. Designing logic around the account model is not as trivial as with the UTXO model and can have potential implications on other design concepts within the platform as it continues to grow.

Conclusion

Within cryptocurrency platforms, there are a diverse set of design concepts and technical mechanisms that go into the platform being able to function as a viable, secure, and usable system.

The transaction models used by such platforms employ the use of cryptography to verify ownership of tokens across the network. The UTXO scheme works superbly for Bitcoin, while the Account Based model used in Ethereum is geared to supporting its more complex application and contract needs.

Subsequent iterations of these platforms may tweak and optimize these mechanisms to better suit the future development of their respective networks, however, being able to understand their current implementations will go a long way to enabling a more comprehensive understanding of how their networks work and why they are so novel.

The post Comparing Bitcoin & Ethereum: UTXO vs Account Based Transaction Models appeared first on Blockonomi.