Account Abstraction Layer Overview

Building on bitcoins reliable and proven-to-deliver blockchain, Qtum stacks its Account Abstraction Layer, allowing the Bitcoin Core 0.13 blockchain to seamlessly interact with the Ethereum Virtual Machine (EVM). With this innovation it is now possible to execute smart contracts and run decentralized applications, simply and securely, in environments that were previously out of reach for Ethereum, combining the endless possibilities provided by smart contracts with the stability and maturity of the bitcoin ecosystem.

Until now, attempts to implement smart contract solutions on top of the bitcoin blockchain have had issues, been lackluster, or failed to break into the mainstream business market. This is primarily due to the fact that the bitcoin blockchain employs an Unspent Transaction Output (UTXO) scheme to associate coins with addresses, rather than the easier to understand, but otherwise problematic, account-based model used by Ethereum.

An account based model works pretty much the way one would imagine:  if Alice has 10 tokens, and sends 5 of them to Bob, who has zero tokens; 5 tokens are simply subtracted from Alice’s balance and added to Bob’s, who now owns 5 coins.  On a UTXO blockchain, however, Alice does not directly hold 10 tokens, but a series of outputs, which are collections of coins resulting from previous transactions.

In such a model, instead of owning 10 tokens, Alice would, for example, hold 3 outputs: (a) consisting of 6 coins, (b) consisting of 2 coins, and (c) consisting of another 2 coins. In this scenario Alice couldn’t simply send 5 coins to Bob, but instead she (or her wallet, for that matter) would have to pick the best-suited output and receive “change” in return (a process called coin picking). In our example this means that Alice would transfer output (a), consisting of 6 coins, and receive 1 coin back as “change”. This “change” is what is called the Unspent Transaction Output, or UTXO. After the transaction Alice would still hold 3 outputs, this time (a) consisting of 1, while (b) and (c) remain 2.

Employing such a seemingly complex bookkeeping scheme allows the Bitcoin blockchain to support Simple Payment Verifications or SPVs. The SPV protocol enables the support of light wallets, which are wallets that can interact with the Bitcoin network in a decentralized and trustless manner, without having to download the entire Bitcoin blockchain. This property is immensely useful for mobile applications or in any low bandwidth/storage environment.

Until now, Ethereum smart contracts couldn't execute in such environments exactly because Ethereum’s account based blockchain does not provide a SPV analog. To solve this, Qtum builds its decentralized application platform on the proven-to-deliver Bitcoin blockchain and introduces the Qtum Account Abstract Layer, which serves as a communication layer between the Bitcoin Core 0.13 protocol and the EVM.

To achieve this, Qtum has extended the Bitcoin 'Script' language, adding 3 ‘opcodes’ so that it functions as a vehicle to transport code to the EVM, while adding special processing conditions, executing these EVM-using transactions immediately when added to the blockchain - allowing the EVM to operate within a UTXO environment.

In order to relieve Qtum smart contracts from the need to perform coin picking for every transaction, Qtum comes coded with an automated, generic coin picking algorithm which allows contracts to ignore the UTXO mode of operation, while functioning normally, as if deployed in an account-based environment. This method is what enables Qtum to be compatible with pre-existing Ethereum smart contracts, allowing them to be executed on Qtum with little to no change to their code.

For more information about Qtum’s architecture in general, please read the blog post or review our Technical Whitepaper.    

Blog: How Qtum makes Ethereum contracts run over the UTXO model

Whitepaper: Qtum Technology Whitepaper