What is Chain33?
Chain33 is a pluggable, layered and efficient blockchain architecture with low development barrier and easy to upgrade. It can be used to develop public chain, consortium chain, and private chain, and it is the first company that establishes parallel chain (hereinafter referred to as parachain) architecture and modular system. Hangzhou FUZAMEI Technology Co., Ltd. (hereinafter referred to as FUZAMEI) spent 5 years developing the Chain33.
Founded in 2008, FUZAMEI has the core technology of low latency and high concurrency in the matching trading system. In 2013, the company started the development and innovation of blockchain and smart contracts. In 2014, it applied for the first blockchain invention patent, which was the wallet retrieval function. And it was authorized in December 2017. So far, FUZAMEI has applied for more than 200 invention patents for blockchain technology, of which 7 have been authorized, ranking 8th in the world.
After 5 years of research and development, on November 19, 2018, FUZAMEI officially initiated the open source project — Chain33, which is the core technology of FUZAMEI.
1. Basic Information
Open Source Date: November 19, 2018, on GitHub
Open Source Address on Github: https://github.com/33cn/Chain33
Chain33 Developer Platform Official Website: https://chain.33.cn/
Twitter: https://twitter.com/FuzameiLtd (@FuzameiLtd)
Development Team — FUZAMEI Enterprise official website: https://33.cn/
Supported Consensus Mechanism: support for pluggable consensus
Public Chain: POS (case: bityuan), DPOS+BFT (case: Yuan Chain YCC)
Consortium Chain: Tendermint, PBFT
Private Chain: RAFT
Supported Platform Language: Golang
2. Introduction to Chain33
2.1 Chain33 Solves Industry Problem
The blockchain bottom architecture is considered to be the foundation of blockchain technology. Public chain, consortium chain, private chain, many applications on the chain, and various blockchain solutions must rely on a stable and reliable bottom architecture.
However, as a novel distributed data storage system, most developers face the problems of high learning barrier, large development workload, and time-consuming when using a new bottom architecture. Faced with this situation, we conducted a large number of market research and developers follow-up, analyzed and summarized the advantages and disadvantages of similar projects, and spent 5 years in building the Chain33 blockchain developer platform.
The blockchain bottom architecture system can be used to build public chain, consortium chain, and private chain, among which the public chain attracts attention and the market application prospect is greater than others.
At present, there are some public chain development teams on the market, but the barrier for public chain development is extremely high, and the related talents are scarce. So it costs a lot to develop with huge difficulties and long duration. It is difficult for enterprises that really need blockchain technology or those want a transition to complete development independently, and it also limits the combination and exploration of blockchain technology on the commercial side.
Is there a low barrier, easy-to-develop and efficient blockchain bottom architecture on the market?
Therefore, the Chain33 developer platform comes into being, aiming to establish a developer-friendly blockchain environment.
Modular design, easy to deploy your chain: Chain33 adopts modular design and provides more than ten modular functions. Developers can combine applications freely and develop easily. It only requires basic programming skills for developers to create a public chain, and it does not cost a lot to develop the blockchain bottom architecture by themselves.
High compatibility, low application barrier: Chain33’s compatibility is extremely high, applications can be developed on Chain33 barrierlessly whether it is large or small.
Modifiable kernel and pluggable consensus meet your every need: Unlike other public chains, only DApp can be developed on most of them, Chain33 opens modification of the kernel, and the kernel is redeveloped. Furthermore, the kernel is so small that can be replaced by pluggable mode.
Invention of parachain architecture, taking into account the security, high performance, and diversified ecology: Finally, Chain33’s invention of parachain architecture, takes into account the safety and operational efficiency of the main chain, at the same time, Chain33 can use parachains to create diversified ecology, leading to exciting market application prospects .
2.2 Chain33 Technical Architecture
At present, the Chain33 technical architecture supports the two major blockchain demand scenarios on the market, called “public chain architecture” and “consortium chain and private chain architecture”.
Introduction to Chain33 Architecture
The Chain33 architecture is divided into five levels, which are data layer, network layer, consensus layer, incentive layer, and application layer.
Application layer: Compatible with Ethereum smart contracts, application layer supports native capabilities, such as issuing tokens, asset transactions, wallet retrieval, hash locks, and supports for extensible executors (contracts).
Consensus layer: Pluggable consensus algorithm, consensus layer supports for public chain consensus of POS and DPOS, Tendermint and PBFT consortium chain consensus, Raft private chain consensus, parachain consensus, etc.
Data layer: Currently, the data storage mode is scalable by MPT, MAVL, KVDB, and MVCCKVDB.
Chain33 Parachain Architecture Introduction
The parachain is a major feature of public chain architecture.
In order to solve the problem of blockchain expansion and TPS limitation, currently, the main solutions include “fragmentation technology”, “sidechain” and “DAG” on the market, in which the fragmentation technology is the mainstream form. However, all of the above three solutions have certain problems, and there is no perfect solution. The concept of parachain provides a better choice. Chain33 is the first blockchain system in the industry to propose the concept of parachain architecture and solve the two problems of expansion and TPS.
Since then, the parachain has been approved by Baidu and Alibaba and they conduct follow-up studies as well. It also has proved that the parachain concept is forward-looking. However, improving the performance of blockchain network is only one of the basic attributes of parachain architecture. The core competitiveness of parachain is to greatly reduce the barrier for deploying public chain. Therefore, the parachain can also be understood as “parallel public chain” and “small public chain”.
Overview and Illustration of The Parachain Architecture
The parachain consists of a number of chains with the lowest layer of Chain33. The transaction is sent to the main chain and is packaged by consensus. Then it is synchronized to the parachain and executed. The final execution result will be written back to the main chain for consensus. Finally, it realizes the separation of consensus and transaction execution, improving TPS.
The parachain is open to all groups and is one of the public chain categories. It is not only a DApp application but also a blockchain built on the main chain. It owns personal blockchain ecology, a separate wallet, and a blockchain browser. Meanwhile, parachain uses the consensus of the main chain and combines with the API and SDK of the open platform. In this way, users can develop their own application chain. Therefore, it is ideal for SMEs who need to build their own business ecosystem.
2.3 System Characteristics of Chain33 Developer Platform
Simple and easy to use: It is easy for developers to learn and deploy blockchain, which is the primary vision of Chain33. Theoretically, a blockchain main chain network and a parachain network can be deployed quickly only with an executable file, several configuration parameters, and a single line of startup command.
Efficient: In the consortium blockchain, transactions are shared and stored on the main chain. Multiple parachains process transactions at the same time, contributing to improving the efficiency of the blockchain network greatly.
Stable: Parachain architecture helps to improve stability. Complex functions can be developed on the parachain and the main chain will be unaffected. Only the core functions run on the main chain of the consortium chain, thus the whole architecture is simple and stable.
Security: Parachain uses the consensus of main chain security, which is provided by the main chain. Even if the parachain is attacked or damaged, the data can be synchronized quickly from the main chain to ensure data security.
High scalability: Parachain supports the deployment of its own micro-consensus and ecology, supporting cross-chain of the main chain and parachain, and cross-chain transactions between parachain.
2.4 Chain33’s Technological Innovation and Core Competitiveness
2.4.1 Highly modular, KISS-compliant design: pluggable, easy to upgrade
The modular design of Chain33 divides and designs a series of functional modules based on the analyses of blockchain bottom architecture, application development’s different functions, and demands. The selection and combination of modules can constitute different products to meet different needs in the market.
The development of software is actually a process of continuous iterative evolution. Therefore, Chain33 adopts the “development mode from chaos to order”, which is convenient for developers to adjust and expand at any time. In addition, some developers may find that some special business logic needs to be customized by several modes to match that business logic during the development process.
From the perspectives of iteration, refactor, and the scalability of the system, Chain33 takes into account the blockchain bottom architecture, the functions, and demands of different application development, and modularizes the system. All modules of blockchain core can be customized, including mempool queuing mode, crypto signature mode, consensus mode, RPC function, command line’s command, wallet’s internal logic, database storage mode, etc.
With a modular design, similar to building a robot with blocks, placing hands, feet, and other parts of the body in categories, and you can choose to assemble based on your interests. Chain33 provides a variety of modules for consensus, encryption, and storage. Under the architecture provided by Chain33, developers can combine applications freely and develop easily. Therefore, only basic programming capabilities are required to create a public chain and developing the blockchain bottom architecture by users does not cost a lot of money.
Plugins that Chain33 has Open Source:
• PBFT (consortium chain, beta)
• tendermint (consortium chain)
• raft (private chain)
• ticket (public chain)
• solo (test chain)
• sep256k1 (bitcoin, ethereum)
• ed25519 (tendermint, sc)
• sm2 (national cryptographic algorithm support)
• mavl (backend data storage method provided by tendermint)
• mpt (data storage method provided by Ethereum)
• kvmvcc (the highest performing blockchain backend storage method so far)
• evm (Ethereum virtual machine support)
• wasm (no open source)
• cert (consortium chain permissions management)
• hashlock (hash lock, and cross-chain usage of btc and eth)
• paracross (parachain is just one of our plugins, so the visible kernel is very small)
• privacy (similar to Monero’s privacy protection implementation, users can learn a lot from this example. It shows our system’s scalability is powerful, and the Monero is a utxo model, but it can also be compatible with the account model in our system)
• trade (an exchange built inside that can support trades of all assets on the chain)
2.4.2 Pioneering parachain architecture
It took five years to design parachain architecture of Chain33, which is the first parachain concept realized in China. In September of the same year, Baidu released the “Blockchain White Paper V1.0”, which also proposed parachain, and then the concept of parachain was successively cited by peers.
Chain33 adopts parachain architecture based on the public chain. It is designed under the comprehensive consideration of the advantages and disadvantages of POW and POS mechanisms. Because many people think that as long as you deploy a few nodes, or buy a mining machine to mine, you can ensure the safety of the public chain. However, in fact, the frequent occurrence of digital currency theft shows that even the most secure PoW mechanism’s control will be lost when a large mining pool is attacked. The problem with PoS is that the number of participants must be sufficient and the mining nodes are sufficiently dispersed. Otherwise, if there are not enough people to reach a consensus, it will also affect network security. The design of the parachain architecture not only ensures the safety of the main chain but also improves the operating efficiency of the main chain.
A major feature of parachain is the separation of data deposits and business logic to improve operational efficiency. Only the instructions and results are stored on the main chain without placing the virtual machine. More complicated business logic is implemented on the parachain. The advantage of doing it in this way is that if there is a problem with the performance of parachain or the smart contract is attacked, the main chain’s stable operation will not be affected.
But this does not mean that the parachain is completely subject to the main chain. It is also a relatively independent blockchain network that can write a variety of smart contracts, such as issuing various tokens, developing DApp, owning independent wallet and independent blockchain browser, etc. Parachain transactions are verified and proofread by its own nodes without affecting the main chain.
2.4.3 The first blockchain invention patent: wallet retrieval function
In 2014, FUZAMEI applied for the first blockchain invention patent: the wallet retrieval function, which was authorized in December 2017.
This technology is also used in Chain33. The wallet retrieval function solves the problem of digital asset loss caused by the loss of the private key. When the user loses the private key due to the wallet missing or the sudden damage of the storage device, the digital currency can be retrieved through the low-privileged backup private key (self-saved or in the custody of trusted institution/person). The retrieval command will not transfer digital assets immediately but will take effect after a period of time. Therefore, if the backup private key is fraudulently used, the user can also find out in time, and use the original private key to transfer the digital assets to the security wallet to avoid losses.
2.4.4 Privacy protection function
Blockchain is untamperable and distributed, which to some extent, protect users’ privacy from central institutions，mitigating the risk of private data abuse. However, open and transparent bookkeeping makes a large number of user data exposed on the chain, thus, the privacy issue cannot be solved in the root. For example, people used to shop on Taobao, now the system turns to decentralized, which means one person mails good to another one directly without Taobao transactions. Although there is no transactions’ data stored on Taobao, the data is recorded on the blockchain network and can be viewed by anyone.
Based on the account and UTXO hybrid model, Chain33 implements privacy trading system of the blockchain. While applying the UTXO system, it retains the account system, joins the ring signature and one-time address, and allows the account flowed freely between privacy and disclosure, is untrackable and non-connectable as well.
FUZAMEI has domestic technology, owns intellectual property with 100%, and has applied for more than 200 invention patents for blockchain technology, of which 7 have been authorized, ranking the top 8 in the world.
2.5 Chain33’s Development Language
The development of Chain33 mainly uses Golang, which is mainly considered from the following points:
2.5.1 Language maturity considerations
The large system developing experience is a significant standard to evaluate whether a language is a mature language. The two core systems in the cloud computing world, docker and k8s are both developed with Golang. At present, most blockchain systems are also chosen to be developed with Golang. Therefore, it is necessary to learn Golang language if you want to do a blockchain related job.
2.5.2 Number of developers
The entry cost of learning a language is relatively low, but it takes several years to master the class library and best practices. Therefore, niche language is definitely not taken into account. At present, Golang ranks 10th in the world’s many languages and is supported by many developers.
2.5.3 Engineering features of the language
When the Golang was designed, the problem of engineering practice was considered. There is only one way to write about the solution to a problem. Golang provides gofmt, which automatically formats the code so that everyone writes the code style very consistently and there is no barrier to communicate with each other.
2.5.4 Available for most ordinary programmers
A very important reason for choosing Golang is that a medium-level programmer can write Golang code well. The main reason is that Golang is simple, the features are small and the official class library is rich that most programmers can easily develop.
2.6 Chain33 Application and Ecology — A Successful Case Based on Chain33
The Chain33 development platform can be used for the public chain, consortium chain, and private chain development and deployment, as well as DApp application development for various business scenarios.
Public chain case: At present, public chain cases that have been successfully built on Chain33 include: bityuan blockchain network (BTY), enterprise blockchain SaaS platform-yuanchain (YCC). DApp developers can develop based on the above public chain, or deploy public chain and parachain by themselves.
Bityuan BTY official website address: https://www.bityuan.com/
Yuanchain YCC official website address: https://www.yuan.org/
Consortium chain, private chain case: the consortium chain cooperation of Xiaomi and FUZAMAI
Parachain cases: Shopping TO — blockchain mall, Chat33 — blockchain social medium, Huoshi — blockchain imported food traceability system, art collection industry — Jinsinanmu chain, industrial boiler and energy-saving industry — energy-saving chain, Starsunny- blockchain medical smart wearable device, blockchain games — rock-paper-scissors, etc.
Blockchain application of various business scenarios: The performance of Chain33 has proven to be sufficient to support commercial-class applications, including supply chain finance, warehouse receipt transactions, bill matching systems, etc., and can be applied in a variety of industries, such as manufacture, logistics, finance, etc. Different industries can develop public chain on different parachain, and two parachains do not affect each other.
Supply chain system application: 1、blockchain receivables 2、blockchain prepayments 3、supply chain finance and management platform
Financial leasing, financial warehousing blockchain platform: blockchain warehouse receipt mortgage transfer and financing, blockchain financial leasing, etc.
Blockchain point system, payment system
Blockchain exchange, etc.
2.7 Market Comparison
2.7.1 Overall Structural Comparison
Taking the well-known and mature Graphene and Fabric in the market as examples, the overall structure is as follows:
2.7.2 Technical Characteristics and Structure Comparison
Ethereum and Hyperledger are relatively mature blockchain platforms. The comparisons between Chain33 and these two are as follow:
Ethereum Smart Contract Deployment Process
Build an Ethereum private chain environment and generate the private chain genesis block.
Start the private chain, generate an initial Ethereum account, and start mining (mining requires an account to receive Ethereum).
Write smart contracts, solidity and mix languages.
Smart contracts and simple contracts for the individual file can be compiled online, multiple files need to use solc (compiled into strings, whole network synchronization).
Deployment, contract deployment regarded as transaction records on the chain needs to pay a certain amount of Ethereum, and the operation requires gas.
Hyperledger Smart Contract Deployment Process
Plan the organization of consortium chain, and then edit the fabric’s configuration file (including related certificate file, system channel initial block, application channel transaction file, anchor node configuration update transaction file, etc.)
Edit docker-compose file (need to understand the meaning of each parameter inside, currently, the consensus in the fabric’s open source code supports kafka and raft only), start 4 peer nodes, an order node forms a kafka.
Deploy the SDK program corresponding to the fabric.
Write the smart contract for fabric.
Create a channel through SDK and add the peer node launched above to the channel, and install then initialize the chaincode (smart contract), and deploy then initialize the smart contract at each node.
Execute smart contract.
Chain33’s Smart Contract Deployment Process
Golang deployment method
Write smart contract using Golang, which can be compiled into a binary file with Chain33.
Execute smart contract through the interface invoking smart contract.
EVM deployment method
Write smart contract in Solidity.
Deploy smart contract to the EVM virtual machine on Chain33 through the interface provided by Chain33.
Execute smart contract through the interface invoking EVM contract.
WASM deployment method
Write smart contract in C++.
Deploy smart contract to the WASM virtual machine on Chain33 through the interface provided by Chain33.
Execute smart contract through the interface invoking WASM contract.
JSVM deployment method
Deploy smart contract into JSVM virtual machine of Chain33 through the interface provided by Chain33.
Execute smart contract through the interface invoking JSVM contract.
Horizontal Comparison and Contrast Between Systems
3. Introduction of Technical Development Team
33 FUZAMEI Technology Co., Ltd. was established in 2008 and has core technologies for low latency and high concurrency in trading systems. In 2013, it initiated the development and innovation of blockchain and smart contracts. In 2014, it applied for the first blockchain invention patent: the wallet retrieval function and was authorized in December 2017. At present, it has accumulatively applied for more than 200 invention patents for blockchain technology, of which 7 have been authorized and ranked top 8 in the world.
The company is headquartered in Hangzhou and sets up branches in Shanghai and Nanjing. At present, the company employs nearly 150 people, of which most are technicians, attracting a group of executives and programmers such as Oracle and Alibaba to join.
The Chain33 developer platform is dedicated to presenting developers with an easy-to-use, high-performance, stable, and secure blockchain bottom architecture. It applies for nearly 200 blockchain patents, ranking the top 8 in the world. After 5 years of painstaking research and development, the company has pioneered the parachain architecture and modular system. What is more, the main chain recognizes data stored and transacted on the blockchain and parachain processes the business logic, which greatly improves the performance, security, and stability of the blockchain network.
The Chain33 developer platform can be used to develop and deploy public chain, consortium chain, and private chain, as well as blockchain solutions and commercial applications for various business scenarios, such as supply chain finance, asset transacted on the chain, various types of DApp, etc.
Currently, Chain33 completes open source and opens to developers around the world. Any developer can check the code of Chain33 on Github (https://github.com/33cn/Chain33) and join the developer community of Chain33.
Chain33 Developer Platform Link
Official website: https://chain.33.cn/
Product file: https://chain.33.cn/document/60
Resource kits download: https://chain.33.cn/resource
Github open source community: https://github.com/33cn/Chain33