With the advent of BTC system, 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. In the economic model, consensus mechanism, cryptography and other technical problems behind the blockchain public chain, there has always been a “ternary paradox” problem (also known as the “Impossible Triangle” problem), that is, in the blockchain public chain, the three characteristics of “decentralization”, “security” and “scalability” cannot be integrated It’s a good combination.
- “Decentralization“It 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 will be. This is also the core feature of the blockchain which is different from the traditional Internet system.
- “Security“Blockchain” refers to the cost of obtaining the control right of the blockchain system. The higher the cost, the higher the security. This is also the basis for the blockchain system to enable the participants to form a “consensus”.
- “ScalabilityIt means that the ability of the blockchain system to process transaction information largely depends on the transaction processing performance, that is, TPS (the number of transactions processed per second). It has been proved that scalability is the biggest obstacle (such as bitcoin) that the blockchain system can not be applied to practical application scenarios. The main reason for this result is that every transaction has to be agreed on all nodes, And the cost of each node participating in the blockchain system.
In fact, in the “ternary paradox”, each of the three features has its own independent technological development route. Sacrificing one feature does not mean that it can be exchanged for the improvement of another feature. It is just that under the existing technical conditions, a blockchain system will usually have a choice if it wants to maximize the integration of the three features; moreover, if it abandons the “decentralization” in the “ternary paradox”, it will not be able to achieve the same goal So we can see that in recent years, when trying to break through the “three paradoxes”, the most common priority of block chain public chain systems is to optimize system performance by improving TPS.
Therefore, as the first article in this series, I would like to start from the aspect of scalability and talk about some methods and technical routes that can improve the “scalability” of blockchain system at present. I hope that after reading this article, when you see slogans like “tens of millions of TPS”, you will have a deeper understanding.
Before talking about scalability, let’s first understand the concept of “TPS”, the core index of 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 the performance of the system. TPS is calculated by dividing the total number of transactions in a period of time by the number of seconds in that period to get an average value. This average value does not mean that the system will process the same amount of transactions per second, and the system actually processes the same amount of transactions in each time The number of transactions processed in a time period varies from high to 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 period, the TPS of bitcoin is 2400 / 600 = 4. Yes, in fact, the TPS of bitcoin is only about 4.
Figure of bitcoin historical transaction volume (the figure above is from BDS blockchain data service of JD Zhilian cloud)
As a comparison, here are some data references for you: visa is around 1600tps (peak 56000tps), the peak activity of Netcom double 11 is around 100000 TPS, the current mainstream blockchain system Ethereum is about 20tps, and the centralized blockchain system XRP is only about 1500tps.
Therefore, when returning to the real application, TPS of blockchain public chain system is an unavoidable problem.
Theoretically, when the bandwidth is infinite, the data transmission delay is infinitesimal, and the computing power is infinitesimal, the efficiency of data consensus in the blockchain system can be infinitely high, and the TPS can also be infinitely high; but in practice, the bandwidth and computer processing capacity of most users participating in the blockchain system are very limited, so for the designers of the blockchain public chain system It is a great challenge to minimize the energy consumption of user network while ensuring the optimal performance of network.
In recent years, in order to improve the System TPS, all public chain project parties have found a new way in technology, and some professional terms related to it continue to appear in the industry, such as pow, POS, cross chain, fragmentation, DAG, asynchronous consensus group, zero knowledge proof, etc.
Papers on asynchronous consensus group on NSDI
Among these technologies, the main ways to improve the scalability of blockchain public chain system (mainly TPS) are as follows: first, change the consensus mechanism; second, replace the DAG network; third, use cross chain technology; fourth, use fragmentation technology.
1、 Change the consensus mechanism: in addition to the pow (proof of work) consensus mechanism used in BTC system, POS (proof of stake), dpos (delegated proof of stake), algorand (POS upgrade, pure equity certificate), pbft (Practical Byzantine fault tolerance) are more popular in the industry, There are at least hundreds of consensus mechanisms in the market, if we include various “upgraded” and “improved” versions. However, most of these consensus mechanisms are to improve the TPS shortage caused by the pow used by bitcoin. In the process of improvement, various consensus mechanisms have taken various trade-offs and compromises.
As the pow used in BTC system has been standing for more than 10 years, many consensus mechanisms at first iterated on the basis of pow to optimize TPS, such as adjusting block size, changing block structure, decoupling block generation and transaction packaging process. However, these adjustments not only improve TPS, but also bring some new problems, such as increasing block size Although a small block can store more transactions in a single block, the larger the block, the higher the network transmission delay, thus increasing the risk of bifurcation. For another example, bitcoin ng can achieve a high TPS under the pow consensus, but it will also cause the problem of excessive power of individual nodes.
Based on this, consensus mechanisms, such as POS and algorand, which completely violate the original intention of pow, have emerged. These consensus mechanisms are aimed at subverting the concept of “mining” of pow mechanism, and promoting the consensus concept of “the biggest vested interest in the system will not harm the system” (similar to the shareholder mechanism in traditional enterprises). Because these mechanisms sacrifice decentralization more or less, users are not satisfied There is basically no need to mine and there is no heavy hash calculation process, so the system can enable users to participate in it very quickly and generate blocks with larger size than pow, so its TPS performance is naturally much higher than pow (some public chain projects claim to be up to millions or tens of millions of TPS).
2、 Replace DAG networkThe basic structure of blockchain is to connect blocks in the form of chain Graph directed acyclic graph (DAG) replaces the chain structure with the network structure, cancels the concept of transaction block, and replaces each transaction with other multiple transactions (the latter transaction verifies the previous transaction), so as to reach a consensus on mutual verification among transactions, so as to improve the overall verification efficiency of DAG by transaction volume, and finally achieve the purpose of improving TPS.
Dag schematic diagram
However, the advantages and disadvantages of DAG are obvious. First of all, DAG has two main advantages. One is that DAG can record more data through asynchronous concurrency under the condition of limited bandwidth, so as to improve TPS. The other is that DAG structure avoids the waste of computing power when the computing power of traditional chain structure is too large, and it is easy to fork. The other is that DAG has two main disadvantages The second is that the security has not experienced large-scale verification similar to that of bitcoin.
3、 Adopt cross chain technologyCross chain is divided into two ways: Multi Chain and side chain. Multi chain, as the name suggests, is to use multi chain parallel mode for transaction. Compared with single chain mode, the TPS of Multi Chain parallel mode must be larger than that of single chain mode. However, with the increase of transaction volume, the demand for cross chain data interchange increases with time. A fund may flow on multiple chains, and an account will also flow on multiple chains In the implementation of Multi Chain parallel, TPS calculation is often simple accumulation. With the maturity of Oracle and other cross chain technologies, multi chain is bound to have a great development prospect.
Cross chain diagram
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 take place under the chain, and only the final state is verified on the main blockchain, so as to solve the TPS pressure brought by frequent transactions of the same pair of users on the blockchain system and indirectly improve the scalability of the blockchain system. For example, there are two merchants trading with each other many times in a day, but at the end of the day, they find that they have traded with each other more than 1000 times, but the transaction amount just equals to zero. This is the most suitable scenario for the use of side chain technology. It represents the lightning network of the project and the Raiden of Ethereum. However, it should be emphasized that although the side chain helps to reduce the pressure on the blockchain system, the number of its TPS should not be included in the TPS of the blockchain system.
4、 Using slicing technology: fragmentation technology, that is, each fragmentation after each transaction block is decomposed is released to the blockchain network, and each fragmentation is in parallel state, so that each node does not have to download all the transaction data, thus greatly improving the processing speed of the blockchain system. It should be noted that the biggest difference between fragmentation technology and cross chain technology is that all fragmentation is still based on the same chain. Therefore, it is very challenging to effectively cooperate among different fragmentation to maintain the order and correctness of consensus.
Block chain and database slice comparison diagram
TPS calculation under the condition of fragmentation shall be subject to the final state of the transaction. It is a common practice to add up the pieces for publicity, but it is lack of practical significance. Fragmentation is the current hot direction. Zilliqa is the first one to use fragmentation technology. Other projects such as eth2.0 and harmony have been trying to integrate fragmentation technology into blockchain system.
It can be seen that the technical route to improve TPS has its own advantages and disadvantages and challenges. I hope that through the articles in the special series of “three paradoxes” of JD Zhilian cloud blockchain public chain, you can understand the characteristics of blockchain public chain system from the three aspects of “decentralization”, “security” and “scalability”, as well as its application in practical scenarios Can better choose a suitable blockchain system to solve some problems.
JD Zhilian cloud blockchain data service [BDS]: JD Zhilian cloud structurally stores the chained and unstructured data of the blockchain through technical means, synchronizes them to the high-performance database in real time, and accordingly introduces a visual blockchain data query service (BDS), which helps users complete simple conditional query and complex SQL native query.
- It covers dozens of well-known blockchain projects such as BTC, ETH, EOS, LTC, XRP, BCH, etc., and has customized 100 blockchain projects involving users, transactions, blocks, etc+
Exclusive data indicators, online can query the real-time data on the chain, which is convenient and fast.
- It supports standard SQL query statements, which can easily realize complex query logic; relying on the software, hardware and architecture support of JD Zhilian cloud, it has the characteristics of fast query speed and high query efficiency.
- It supports graphical and visual interface. It can query data through click and drag interaction. It can generate all kinds of Bi charts in real time and customize your blockchain data dashboard.
Click [read] to get the latest data of blockchain mainstream public chain