UTXO based smart contract vs Account based smart contract

UTXO stands for “Unspent Transaction Output”. Many blockchains use UTXO based accounting methods, for example, Bitcoin and Litecoin blockchains, as opposed to an account-based accounting method. If the UTXO accounting method is used in real life, we will only record the current owner of each bank note. Since this bank note has not been spent by the current owner yet, it is called an Unspent Transaction. If the account balance is needed, a quick calculation will be made by adding the value of all the bank notes held by him/her. In the UTXO model, each UTXO represents the current location of the bank note. The account based accounting method is different. Instead of tracking the location of each bank note, the system simply maintains the account balance of each individual. The accounts can be controlled by a private key, or by a smart contract. A transaction is recorded by adding and subtracting the same amount of tokens from the sender and to the recipient respectively. However, for the purpose of validation, transactions also need to be recorded, but the application developer could ignore it.

Smart contract is initiated by Ethereum blockchain which is an account based blockchain. The smart contract, or decentralized applications, can be managed via the address of an account, like other regular blockchain accounts. Naturally, it is easier to be implemented by the account based accounting method. As a result, account-based models are mostly popular among smart contract-focused blockchains. However, it is still necessary to develop UTXO based smart contracts, particularly for Internet-Of-Things applications, why? 

First of all, it is possible to process multiple UTXOs at the same time, it enables parallel transaction validation and encourages better scalability and efficiency.  While A and B trade with C simultaneously, in the account based model, both transactions could not be validated in parallel while in the UTXO model, a different UTXO related to C could be used and both transactions could be processed together. Thus, UTXO based smart contracts are relatively easier to scale.

 

Secondly, UTXO is inherently easier for privacy-preserving as the account balance of a user is not stored in the blockchain as well as the interim states, although they could be indirectly calculated. UTXO based smart contracts record the interim states locally and provides opportunities for mixing coins and other privacy protection approaches. In the account based blockchain, the balance of all of the accounts are on the chain.

Thirdly, UTXO saves storage space of the blockchain. As mentioned above, UTXO based smart contract only saves the interim states locally and requires less network bandwidth, and does not like the account based smart contract which is required to save both states and transactions in the blockchain. In the system which has a lot of IoT devices but the interaction between these devices are relatively simple or infrequently, UTXO based smart contract consumes less resources. For example, the device only reports its status once an hour, a UTXO based system will not need to update the account balance of each device every a few seconds as the account based system does.

Fourthly, a UTXO based system is more immune to double spending while an account based system is vulnerable to it. Each UTXO is unique and it is quite easy to detect that the same one has been used twice. In the account system, as the account balance change might be due to multiple reasons, a situational awareness engine is required to identify the double spending attack. 

Please note that the account based smart contract still has its own strength. For example, the framework developer will find it is more intuitive to work with for complex smart contracts, especially those that require state information or involve multiple parties, although the end user might not need to care. In addition, except for a few parameters, it is relatively easy to conduct on-chain metrics measurement with account based blockchain as more information is saved on the chain. Furthermore, the account based system is more efficient to handle transactions. A UTXO could not be split. If needed, it has to be consumed fully and generate two or multiple outputs. This will complicate some smart contracts while it is not a problem for account based smart contracts. 

transaction verification process of Bitcoin
Transaction Verification Process of Bitcoin
Bitcoin As A State Transition System
Bitcoin As A State Transition System

In general, both UTXO and account based smart contracts work. However, UTXO based blockchain could demonstrate strength in the situations where data security or privacy is sensitive, or limited computing power or network bandwidth presents. Industrial IoT, wearable devices, secured financial transactions and etc are potential applications. 

Due to the fact that UTXO based smart contract framework is complex to develop and counter-intuitive, very limited UTXO based Turing complete smart contract is available. Among them, like QTUM, some are not native UTXO smart contracts, instead, they build a translation layer between Etherum-like smart contract layer and the applications to mimic UTXO smart contracts. As a result, the performance is limited. Dappley (www.dappley.com) has a native Turing complete UTXO smart contract. As a blockchain framework, it allows customers to customize their own blockchain and has been optimized for industrial IoT applications. In addition, supported by DappBridge, a decentralized privacy-preserving computing capability and trustworthy data exchanging platform, Dappley can help you to preserve your privacy while engaging third party computation partners.

Leave a Comment

Your email address will not be published. Required fields are marked *