Scalability of the "Triple Paradox" special series of blockchain
Pan Xizhi, Product R&D Department of JD Zhilian Cloud
text

Pan Xizhi, Product R&D Department of JD Zhilian Cloud
With the advent of Bitcoin, blockchain technology has been recognized by more and more people in the past 10 years. Blockchain has built the value network foundation in the era of digital economy. Among the technical issues such as the economic model, consensus mechanism, and cryptography behind the blockchain public chain, there has always been a "trilemma" problem (also known as the "impossible triangle" problem) that has continued to be hot. In the blockchain public chain, the three characteristics of "decentralization", "security", and "scalability" cannot be well combined.
"Decentralization" means that anyone can participate in the production and verification of the blockchain system as a node. The more nodes there are, the higher the degree of decentralization is. This is also the core feature that distinguishes blockchain from traditional Internet systems.
"Security" refers to the level of cost paid to obtain the control of the blockchain system. The higher the cost, the higher the security. This is also the basis for the blockchain system to enable participants to form a "consensus".
"Scalability" refers to the ability of the blockchain system to process transaction information, which largely depends on transaction processing performance, that is, TPS (the number of transactions processed per second). Facts have proved that scalability is the key to today's blockchain The biggest obstacle (such as Bitcoin) that the system cannot be applied to practical application scenarios. The main reason for this result is that each transaction must be agreed on all nodes, and the cost paid by each node to participate in the blockchain system.
In fact, in the "trilemma", the three characteristics have their own independent technological development routes, and sacrificing one characteristic does not mean that another characteristic can be improved, but only under the existing technical conditions, If a blockchain system wants to maximize the integration of these three characteristics, there will usually be trade-offs; moreover, if the “decentralization” and “security” in the “ternary” are left out, there is no way to talk about it. "Blockchain" and "system", so we have seen that over the years, when various blockchain public chain systems try to break through the "trilemma" problem, the most common priority is to optimize the system by improving TPS performance.
Before talking about scalability, let's first understand the concept of the core indicator "TPS" in scalability:

TPS (Transaction Per Second) refers to the average number of transactions processed by the system per second. For a blockchain public chain system, TPS is an important indicator to measure system performance; The number of transactions divided by the number of seconds during this period is an average value. This average value does not mean that the system will process the same amount of transactions per second. The actual number of transactions processed by the system in each time period is high or low. Low, take Bitcoin as an example, because the interval between two blocks of Bitcoin is 10 minutes (600 seconds), if there are 2400 transactions in the packed block during this time, then the TPS of Bitcoin is 2400/600 =4, yes, in fact, the TPS of Bitcoin is only about 4.image description)
Bitcoin historical transaction quantity chart (the above picture is from JD Zhilian Cloud
BDS blockchain data service
For comparison, here are some data references for you: Visa is around 1600TPS (peak value is 56000TPS), the peak of Netlink Double 11 activity is around 100,000TPS, the current mainstream blockchain system Ethereum is currently around 20TPS, and the centralized area The block chain system XRP is only about 1500TPS.
In theory, when the bandwidth is infinite, the data transmission delay is infinitely small, and the computing power is infinitely strong, the efficiency of data consensus in the blockchain system can be infinitely high, and the TPS can also be infinitely high; but in reality, participation The bandwidth and computer processing power of most users of the blockchain system are very limited. Therefore, for the designers of the blockchain public chain system, it is necessary to minimize the energy consumption of the user network while ensuring the optimal performance of the network. , has become a very big challenge.

In recent years, various public chain project parties have found new ways to improve the system TPS, and some related professional terms have emerged in the industry, such as POW, POS, cross-chain, sharding, DAG, asynchronous consensus group, Zero-knowledge proofs, etc.
image description
Paper on Asynchronous Consensus Groups at NSDI
Among these technologies, the current mainstream ways to improve the scalability of the blockchain public chain system (mainly to improve TPS) are roughly the following: one is to change the consensus mechanism, the other is to replace the DAG network, and the third is to adopt cross-chain technology , the fourth is the use of fragmentation technology.
1. Change the consensus mechanism: In addition to the POW (Proof-of-Work proof of work) consensus mechanism used by Bitcoin, the more popular ones in the industry are POS (Proof-of-Stake Proof of Interest), DPoS (Delegated Proof of Stake) Delegated proof of equity), Algorand (POS upgrade, pure equity proof), PBFT (Practical Byzantine Fault Tolerance, practical Byzantine fault tolerance algorithm), etc., if you count various "upgraded versions" and "improved versions", there are at least Hundreds of consensus mechanisms can be found, but the emergence of these consensus mechanisms is mostly to improve the lack of TPS caused by the POW used by Bitcoin. In the process of improvement, each consensus mechanism has also adopted various Tradeoffs and compromises.
Based on this, PoS, Algorand and other consensus mechanisms that completely violate the original intention of Pow emerged. These consensus mechanisms aim to subvert the "mining" concept of the PoW mechanism, and to promote to users that "the biggest vested interests in the system will not harm the system." "consensus concept (similar to the shareholder mechanism in traditional enterprises), because these mechanisms more or less sacrifice decentralization, so users basically do not need to mine and there is no heavy hash calculation process, so the system can be used very quickly. Users participate in it and generate larger-sized blocks than PoW, so its TPS performance is naturally much higher than that of PoW (some public chain projects claim to reach millions or tens of millions of TPS).

2. Replace the DAG network: The basic structure of the blockchain is to connect blocks in the form of chains. However, DAG (Directed Acyclic Graph) replaces the chain structure with a network structure and cancels the transaction area. The concept of a block is replaced by connecting each transaction with other multiple transactions (the latter transaction verifies the previous transaction), and each transaction verifies each other to reach a consensus, so as to improve the overall verification efficiency of the DAG by the transaction volume, and finally achieve The purpose of improving TPS.
image description
However, the advantages and disadvantages of DAG are also obvious. Let’s talk about the advantages first. There are two main advantages of DAG. One is that under the condition of limited bandwidth, DAG can record more data in an asynchronous and concurrent manner, thereby improving TPS. The DAG structure avoids the waste of computing power when the computing power of the traditional chain structure is too large, and the problems of easy bifurcation; the main disadvantages of DAG are two, one is that the confirmation time of the final transaction is uncontrollable (relying on the new confirmation The lack of stability caused by the former), and the second is that in terms of security, it has not experienced large-scale verification similar to that experienced by Bitcoin.

3. Cross-chain technology is adopted. Cross-chain is divided into two ways: multi-chain and side-chain. Multi-chain, as the name implies, is to use multiple chains in parallel to conduct transactions. Compared with the single-chain method, the TPS of multiple chains in parallel must be It is larger than the single-chain method, but with the increase of transaction volume, the intercommunication demand of cross-chain data will increase at any time, a fund may be transferred on multiple chains, and an account may also generate transactions on multiple chains, which will bring Therefore, in the implementation of multi-chain parallelism, the calculation of TPS is often a simple accumulation. With the maturity of cross-chain technologies such as oracle machines, multi-chain is bound to have great development prospects.
image description
Side chain technology is also known as "off-chain state channel", which is to build a temporary offline transaction channel between users, all intermediate transactions occur off the chain, and only the final state is verified on the main block chain , solve the TPS pressure brought by the frequent transactions of the same pair of users to the blockchain system, and indirectly improve the scalability of the blockchain system. For example, there are two merchants who trade with each other many times in a day, but at the end of the day, they find that the two parties have traded more than 1,000 times, but the transaction amount just equals to zero. This is the most suitable application of side chain technology. Scenes. It stands for Project Bitcoin's Lightning Network and Ethereum's Raiden. However, it needs to be emphasized that although the side chain helps reduce the pressure on the blockchain system, its TPS amount should not be included in the TPS of the blockchain system.

4. Using sharding technology, sharding technology is to release each shard after each transaction block is decomposed to the blockchain network, and each shard is in a parallel state, so that each node does not have to download all transaction data, thereby greatly improving The processing speed of the blockchain system. It should be noted that the biggest difference between sharding technology and cross-chain technology is that all shards are still based on the same chain. Therefore, it is extremely challenging to efficiently coordinate between different shards to maintain the order and correctness of consensus.
image description
Schematic diagram of blockchain and database fragmentation comparison







