Dr. Feng Cao: PCHAIN multi-chain principle.

PCHAIN
PCHAIN
Mar 8, 2018 · 7 min read

PCHAIN is the first native multi-chain system that supports EVM in the world. Why is it called the native multi-chain system? The so-called native multi-chain system is relative to the traditional single-chain blockchain system. As we known most of the traditional blockchain systems are single-chain systems. For example, the famous Bitcoin blockchain system and the Ethereum system are both typical single-chain systems. The single-chain system is a simple and elegant design. It provides a very good foundation for the synchronization, consensus, and security of blockchain data. In some way, this chain structure has contributed to the success of Bitcoin and Ethereum, which has also led to more recognition of the blockchain technology, and people are hoping to put more and more large-scale applications into the blockchain.

Obviously, the single-chain system, including Ethereum and Bitcoin, has encountered performance bottlenecks in large-scale blockchain applications. It is difficult for them to efficiently process transactions like the traditional Internet, which is 28,800 times better performance with a conservative estimation. Therefore, the idea of multi-chain is born naturally. Multi-chain enables parallel transaction processing, therefore, improving the throughput. In fact, PCHAIN is not the first multi-chain system in the world. However, it is the world’s first multi-chain system supporting EVM.

Comparing to PCHAIN, the other multi-chain systems do not provide the ability to support EVM, and they often do computation based on traditional software such as NodeJS, Java, or Internet programming language and virtual environment. However, as we known, based on the traditional language: on the one hand, they don’t have a good pricing mechanism, so the system is easy to fall into an infinite loop and downtime; on the other hand, it also makes the whole process of smart contracts impossible to be traced.

PCHAIN choose EVM to support considering the followings: (1) its blockchain programming language, Solidity, is relatively new. (2) EVM keeps evolving. The current EVM has the problem of low efficiency. Some improvements like Just In Time EVM is designed to improve the performance of EVM. (3) the smart contract based on EVM has become the largest smart contract ecology in the world. Therefore, PCHAIN provides the support of the original multi-chain level of EVM, which is of great significance.

The multi-chain structure of PCHAIN is shown in Figure 1. In simple terms, it consists of a main chain and a number of derivative chains. However, this design is not a simple structural change.

What are the design ideas behind the PCHAIN multi-chain system? First, the PCHAIN structure shown in the figure above is a structure on the blockchain data. Physically, the blockchain systems mostly are composed of several network nodes. These nodes are used to process the main chain and the derivative chain in the PCHAIN. Thus there will be some mechanisms to choose from. One of the simplest options is that all nodes handle all transaction requests on both the main chain and the derivative chain at the same time. If so, what difference does it make to deal with all the nodes of the single-chain blockchain system? Perhaps different from the general understanding, even though PCHAIN is based on such a network node selection mode, we can still be based on multi-chain blockchain. Thus, we can achieve linear level performance improvement relative to single chain system.

Why is that? Because we know that the complete blockchain generation process consists of three main steps. The first step is the generation of candidate blocks. The second step is the broadcast of the candidate block. The third step is the consensus of the latest block. In a traditional single-chain system, none of these three steps can be done in parallel. In simple terms, the first step is that the system relies more on the system’s CPU or GPU or special chip computing power.In the second and third steps, the system relies on the network communication. The third step is also partially dependent on computing power.

In a multi-chain system, communication between each derivative chain is not required in most cases. So on the one hand, it greatly reduces the cost of communication, and on the other hand, it’s very easy to form a pipeline structure. Therefore, the communication and computation between different derived chains are entirely possible to parallelize.

On the other hand, if all nodes in the network are distributed on the different derivative chain and main chain within the global scope, the parallelization of the whole system will be further promoted, as shown in Figure 3.

Of course, there is also a new problem, which is how to ensure that the nodes on a single derivative chain collude with each other. Therefore, PCHAIN considers the introduction of reward-penalty function, and the nodes on the single derivation chain can be balanced as far as possible to avoid the tendency of centralization through this function.

Multi-chain of PCHAIN is not only for reasons of parallelization, but also because of this the emergence of a new data structure of block, we can see that transactions in a single derivative chain are relatively independent, and the structure would tend to be more same. In the general sense, we can even think that the transactions or blocks on a single derivative chain are made up of a single smart contract. As a result, the data structure stored in the block is fairly same on the entire single chain. This provides the possibility for later data compression and makes the transaction data in the middle of the block more orderly.

This raises a new problem: when too many smart contracts are deployed in the PCHAIN multi-chain system, there are, in theory, a lot of derivative chains, such as hundreds of different derivative chains. This is a huge drain on the node resources in the entire multi-chain system. PCHAIN solves this problem by heuristic rules. These rules will ensure that when a smart contracts in a small scope of operation, it is more likely merged with existing certain small derivative chain. Only when its transactions increase to a certain extent, it will be split into a new independent derivation chain.

The main chain provides registration, search, storage, storage, and other functions of side chains and supports cross-chain transactions. It can create a side chain to complete the specific business logic separately. This eliminates the need for all business transactions to be completed on a single chain, which greatly reduces the running and storage pressures of the main chain. In addition, the side chain can also eliminate the interference of other businesses in the original single chain model.

Of course, when we talked about PCHAIN fragmentation mechanism, in fact, it often refers to the independent subdivision technology which can be used in a single derivative chain rather than the physical and logical separation of several derivative chains. Therefore, under the support of sharding technology, the multi-chain structure will further enhance the parallelization of the whole system and improve the throughput of the whole system.

For a specific chain with more nodes, it uses Sharding at the transaction level. When a chain has too many nodes and transactions, PCHAIN automatically enable this Sharding mechanism within the chain. The specific implementation is as follows:

  1. Mark the current time point as the beginning of a new epoch.
  2. First, PCHAIN divides all nodes in the chain into groups, called execution groups, by verifiable random functions. And then PCHAIN select some of the “qualified” nodes and form a group called the governance group through the same process. (Note: ‘qualified’ means that the node has sufficient PCH and applies to be a member of the governance group.)
  3. It will classify transactions. For example, depending on the user who initiated the request, it sends the transaction to a specific execution group and then executes and validates the transaction within the group, and finally, a consensus is reached at the transaction level.
  4. After a specific time interval, the execution group wraps the list of verified transactions to the governance group. The governance group then aggregates these transaction lists from different execution groups to reach consensus at the block level to form blocks and broadcast to the entire network.
  5. At the end of each epoch, it ensures that all nodes are synchronized to the latest block and are in a consistent state; Then it enters a new epoch.

In this way, transactions actually have parallel execution validation. In a single chain, the charm of single node processing ability is removed.

Improving the processing capacity of blockchain has become the goal of many projects. However, the triangle of efficiency, decentralization, and security is always true. Below we compare the difference between POW and DPOS.

Due to the limited space, this paper mainly discusses the multi-chain mechanism of PCHAIN and the thinking behind such a simple structural design. Thank you.

Official website: https://pchain.org
Telegram: https://t.me/pchain_org

PCHAIN

Written by

PCHAIN