Abstract


Qtum main network was launched on September 14, 2017, and has rapidly grown into one of the most influential public chain projects in the world in one year. Meanwhile, Qtum also takes technology export to more blockchain applications as its technical mission. Therefore, we launched the Qtum Enterprise project [1] with the goal of implementing a blockchain development framework to help developers build their own blockchain networks in one click [2]. To give the public a better understanding of the Qtum Enterprise Edition solution, we conducted a comprehensive and in-depth comparison with other blockchain development frameworks on the market. From the function, performance and other aspects, and put forward our understanding and future planning.


An overview of the


In the field of Internet, with the maturity of a system, it is inevitable to derive the corresponding development framework. Development frameworks usually implement some common functions at the bottom, helping developers to quickly develop the upper application, avoiding the repetition of the wheel to develop the same tools. At the same time, the development specification of the upper layer will be formulated to make the code module of the upper layer more standardized and improved in readability and universality. Common development frameworks in the field of Internet include deep learning Tensorflow, server-side Spring and front-end React.


As blockchain and cryptocurrencies become more widely used, development frameworks are emerging to help developers build more decentralized systems. Early blockchains were mainly developed based on the source code of mature public chain systems, such as Bitcoin’s Bitcoin Core[3] and Ethereum’s Go Ethereum[4]. Later, some development frameworks gradually mature, such as Graphene[5], Hyperledger Fabric[6], etc. Recently, Substrate[7], launched by Parity team, has attracted public attention.


As a mature public chain system, Qtum also exports its technology to more blockchain applications as a technical mission. Qtum is built based on UTXO data structure of Bitcoin and EVM smart contract of Ethereum, and adopts PoS consensus algorithm, which has good performance in compatibility and performance. In order to enable developers to build more blockchain systems based on Qtum, we launched the Qtum Enterprise project [1]. The goal is to provide a blockchain development framework based on the underlying technology of Qtum to help enterprises and individuals build their own blockchain systems with one click [2]. Through hackathons, technical collaborations, and more, some developers have developed their own apps based on Qtum Enterprise.


The technology update in the blockchain field is very rapid, so we are concerned about whether some new technologies in the industry can bring new solutions to the application of blockchain. The recent launch of the Parity Substrate project has led us to re-examine all development frameworks in the blockchain space. We selected the most widely used blockchain development frameworks in the industry, including Bitcoin Core, Go Ethereum, Graphene, Hyperledger Fabric, Substrate, and Qtum Enterprise. A comprehensive comparative analysis was conducted from multiple perspectives of background, functionality, performance, development, and community. To help developers better understand blockchain technology and the Qtum Enterprise project.


BaaS services in existing markets


01

Bitcoin Core

Bitcoin Core is the main implementation of Bitcoin, written in C++ with the code located in [3]. Bitcoin Core is maintained by Core Bitcoin members and has recently released a new version per month on average. Bitcoin Core came first and only included cryptocurrency capabilities, so many earlier cryptocurrency projects were developed on top of it, such as Litecoin, Zcash, etc. BTCD [4], the Go language implementation of Bitcoin, is also often used to develop new blockchain systems. As its technical implementation is the same as Bitcoin Core, only the programming language is different, which will not be described here.


02

Go Ethereum

Go Ethereum is one of the main implementations of Ethereum and the code is located [4]. Go Ethereum is being developed by the official Ethereum team. The Go implementation code is simpler and easier to understand than ethereum implementations in other languages, which appeals to more developers. Since Ethereum was the first to implement smart contracts, many blockchain application projects will be developed based on Go Ethereum. In addition, the Go Ethereum code is also used for side chains and cross-chain projects. Parity Ethereum [10], another implementation of Ethereum, is also very popular, but is rarely used to develop new blockchains.


03

Graphene

The Graphene framework was created by Dan Larimer (BM) and represents projects including BitShares, Steem, and EOS. Graphene is implemented based on C++, the original code [5] is not maintained, but its application project (especially EOS[8]) is constantly updated by the development team. The Graphene framework is characterized by DPoS consensus, where blocks are produced by miners who are voted in, enabling shorter block intervals.


04

Hyperledger Fabric

Hyperledger Fabric[6] is a blockchain solution in the Hyperledger project initiated by Linux Foundation, implemented by Go language, and jointly maintained by IBM and many other enterprises. Hyperledger Fabric mainly faces to the commercial application scenarios of block chain, and proposes a set of solution based on federation chain. The solution focuses on data management and privacy and does not include cryptocurrency implementation. Hyperledger Fabric documentation is the most comprehensive and easy for developers to learn.


05

Substrate

Substrate[7] is a blockchain development framework recently launched by the Parity team. The Parity team maintains one of the main implementations of Ethereum, Parity Ethereum, and is working on Polkadot, a cross-chain project. Substrate, one of the components of the Polkadot project, is written in Rust and uses the latest solutions in the blockchain space — WASM-based smart contracts and Libp2p based networks. In addition, the Substrate’s data structure is highly customizable, allowing developers to store either a trading ledger or any other data. Substrate is still in the functional development stage.


06

Qtum Enterprise

Qtum Enterprise[1] is a blockchain development framework implemented by the Qtum team. Qtum Enterprise is developed based on Qtum public chain and written in C++. The system is compatible with bitcoin’s UTXO transaction model and Ethereum’s EVM smart contract, and uses PoA consensus and DGP protocol to elect super nodes. The advantage of Qtum Enterprise over other development frameworks is its compatibility with bitcoin Wallet apps and Ethereum’s Solidity smart contract code. In addition, Qtum Enterprise provides one-click link sending tools [2] to help developers quickly build their own blockchain networks without having to learn too much about the technical details of blockchain.

Detailed factor comparison


01

The data structure


Bitcoin Core

Transaction, UTXO

Go Ethereum

Transaction, State, Receipt

Graphene

Transaction, Action, Handler

Hyperledger Fabric

Transaction, State

Substrate

Extrinsic, Runtime

Qtum Enterprise

Transaction, UTXO


Data structures on blockchain fall into two main categories:



UTXO — THE UTXO structure represented by Bitcoin Core and Qtum Enterprise. In the UTXO structure, the balance of an address is the sum of all UTXOs of the address. The UTXO structure has the advantage of saving storage space, that is, only recording the changes of data, not the final state. And can realize one-to-many, many-to-one transfer in a transaction, with good concurrency. At last. The disadvantage of UTXO is that it is difficult to be used directly in account-based smart contract systems, so Qtum implemented UTXO to smart contract middleware through AAL (Account Abstraction Layer).


State — Due to the incompatibility of UTXO and smart contracts, most of the other blockchain development frameworks that include smart contracts are based on the State structure. In the State structure, blockchain data is stored in the form of a map, where the key is the account address and the value is the balance, contract and other data on the address. The Transaction function is to modify this map, for example by reducing the balance at one address and increasing the balance at another address.


Go Ethereum, Graphene, Hyperledger Fabric, and Substrate all adopt this mode, but there are certain differences in the logic of Transaction among the three:


In Go Ethereum, any node that consumes a certain amount of tokens can send a Transaction, which economically controls write operations on the blockchain.


In Graphene and Hyperledger Fabric, ordinary nodes need to apply for accounts or certificates from management nodes before they can send transactions, that is, they control blockchain write operations by authorization.


Substrate allows developers to customize the logic and data structure of State (called Runtime) and Transaction (called Extrinsic), so more patterns can be customized.


02

Consensus algorithm


Bitcoin Core

Sha256 (PoW)

Go Ethereum

Ethash (PoW), Clique (PoA)

Graphene

DPoS

Hyperledger Fabric

Kafka (PoA)

Substrate

Aurand (PoA)

Qtum Enterprise

PoA


Both Bitcoin Core and Go Ethereum support PoW consensus, which is completely decentralized, requires a lot of computing power, and is primarily used in the public chain. Compared with Sha256, Ethash consumes more computing power and memory resources.


For enterprise applications, alliance chain, namely DPoS, PoA and other consensus algorithms, will be more considered, so as to obtain higher performance and sufficient management rights. With the exception of Bitcoin Core, all other development frameworks support consensus algorithms for the federation chain. There are some differences between these algorithms, which are listed below:

Super node voting mode. All nodes in DPoS can participate in voting, which is more decentralized. In other consensus algorithms, voting is usually done by a small number of nodes, such as the super nodes of the previous round or some predefined management nodes.


Byzantine Fault-tolerant (CFT) and Byzantine Fault-tolerant (BFT) — Two assumptions can be made about the behavior of supernodes. One is CFT, which assumes that the supernode only fails when it is not working normally, such as when the network is disconnected or disconnected. The other is BFT, which holds that the supernode may have malign behavior in addition to failure, such as sending an error or opposite message. Under the ASSUMPTION of CFT, the consensus algorithm can tolerate the failure of less than 1/2 of the super nodes, while under the assumption of BFT, it can only tolerate the malicious behavior of less than 1/3 of the super nodes. DPoS algorithms commonly used in public chain systems are based on the BFT assumption, while other consensus algorithms are mainly applied to alliance chains, so they are based on the CFT assumption, because super nodes in alliance chains are usually not malicious. BFT consensus is more costly to blockchain performance than CFT consensus, so use CFT consensus if you don’t have to.


Blockchain forks — With the exception of Kafka, the consensus algorithms allow blockchain forks. In alliance chain, fork is mainly caused by some super nodes not working properly. This is also a trade-off between performance and consistency. Consensus algorithms that allow forking can achieve shorter block interval times, i.e. transactions can be confirmed faster. For general applications, supernodes work the vast majority of the time, and forking is rare, so there’s no need to sacrifice performance to avoid forking.


03

Intelligent contract


Bitcoin Core

Script

Go Ethereum

EVM

Graphene

WASM

Hyperledger Fabric

Chaincode

Substrate

WASM

Qtum Enterprise

EVM


Smart contracts are divided into four implementations:


Bitcoin payment Script Script. Only simple logic can be realized, not complex applications.

EVM entry. The most widely used smart contract engine, with the most documentation and examples, and the programming language is Solidity.


WASM. High-performance engines originally designed for browsers have recently begun to be used for blockchains. The programming language is currently C++, with more support in the future.

Chaincode. Used only in Hyperledger Fabric, programming language is Go, documentation and examples are sparse.


Because EVM is the most mature at this stage, with more documentation and examples, it is easier to attract developers to a development framework based on EVM. But you can also see that WASM is rapidly evolving due to its superior performance and public recognition. Qtum is also working on WASM.



04

features

Hyperledger Fabric, Substrate and Qtum Enterprise are all proposed as development frameworks, with their own unique functions, serving different scenarios.

  1. Hyperledger Fabric supports private data storage. Hyperledger Fabric is designed to allow some data on the blockchain to be read only to authorized nodes and not to be synchronized to other nodes. This design allows blockchain to be used in scenarios where data privacy is required.

  2. Substrate supports custom state transition functions. This means that Substrate can be customized into both traditional coin-based blockchains and coin-free blockchains like Hyperledger Fabric, which are more flexible for use in different scenarios.

  3. Qtum Enterprise supports one-click links. Qtum Enterprise’s one-click chain delivery [2] tool helps developers quickly customize their blockchain, even if they don’t know the underlying technology, they can quickly get started and effectively reduce the learning cost and development difficulty.


conclusion

Through comparison, it can be seen that among all development frameworks, Bitcoin Core, Go Ethereum, and Graphene are suitable for the development of public chain, while Hyperledger Fabric, Substrate, and Qtum Enterprise are more focused on the development of alliance chain. In the application scenario of the federation chain, Hyperledger Fabric is required if the application scenario emphasizes privacy. For smart contract applications, Substrate and Qtum Enterprise are good choices. In terms of customization, if you need to deeply customize blockchain, you can try Substrate. If you just want to build applications based on mature underlying systems, IT is recommended to choose Qtum Enterprise.

reference

[1] Qtum Enterprise. https://github.com/qtumproject/qtum-enterprise.

[2] QtumX one-button hair chain. https://qtumx.net/.

[3] Bitcoin Core. https://github.com/bitcoin/bitcoin.

[4] Go Ethereum. https://github.com/ethereum/go-ethereum.

[5] Graphene. https://github.com/cryptonomex/graphene.

[6] Hyperledger Fabric. https://github.com/hyperledger/fabric.

[7] Substrate. https://github.com/paritytech/substrate.

[8] EOS. https://github.com/EOSIO/eos.

[9] Btcd. https://github.com/btcsuite/btcd.

[10] Parity Ethereum. https://github.com/paritytech/parity-ethereum.