Sharding technology: how to solve the performance problem of blockchain?
Produced | Vernacular Blockchain (ID: hellobtc)
Produced | Vernacular Blockchain (ID: hellobtc)
You may also know that one of the most important factors limiting the large-scale application of blockchain technology is performance, which is one of the reasons why many traditional Internet practitioners are not optimistic about blockchain technology.
first level title
01
What is sharding?
Fragmentation is a form of database partitioning, also known as horizontal partitioning, which divides a large database into many small and processable parts, thereby improving performance and shortening response time.
Fragmentation is not a new concept, it appeared in traditional centralized database management as early as the late 1990s. thisThe popularity of this concept is due to Ultima Online, a role-playing game played by multiple players online at the same time.
first level title
02
What is sharding in the blockchain field?
The blockchain is equivalent to a database, and each node is equivalent to an independent server. Under normal circumstances,Only one node of these nodes can obtain the right to record and generate blocks at a time, the remaining nodes that have not obtained the right to generate blocks are equivalent to doing "useless work" and wasting computing power in vain.
If the sharding technology is applied to the blockchain, it is equivalent to decomposing all pending tasks in the blockchain network (such as confirming transactions, running DApps, etc.), and the nodes of the entire network are also grouped, and each group simultaneously Process a decomposed task (such as 150 transactions to be confirmed), so that the original single node handles all the tasks of the entire network into multiple groups of nodes processing in parallel at the same time.
For example, suppose there are currently 8,000 nodes (miners) on Ethereum, and there are 15,000 transactions to be confirmed on the entire network. Ethereum can process 7-15 transactions per second. Under normal circumstances, it takes at least 1000 seconds to process these transactions to be confirmed. Of course, new transactions to be confirmed will be generated during the processing.
If sharding technology is used to divide 8,000 nodes into 100 groups of 80 nodes each, and the 15,000 transactions to be confirmed are divided into 100 partitions with 150 transactions in each partition, then each group of nodes (80) can process their respective Transactions to be confirmed in the partition (150), so that all 15,000 transactions to be confirmed can be processed within 10 seconds at the fastest.
first level title
03
Potential risks of sharding technology
So, is there any defect in sharding technology? The answer is yes.
Although the sharding technology can solve the performance problem of the blockchain to a certain extent and make the blockchain more scalable, it also has two defects.
One is the communication problem between different areas after partitioning.In the above example, the Ethereum network is divided into 100 partitions, each of which is independent, equivalent to 100 independent, parallel Ethereum blockchains, each maintained by a group of miners (80 nodes) and confirm transactions.
These 100 independent Ethereum blockchains cannot communicate with each other. If they want to communicate, it is necessary to increase the communication mechanism across partitions (Similar to broken chain), which will increase the complexity of the blockchain and increase the difficulty of development.
The second is the security of the blockchain.Still the above example, before sharding, the Ethereum network has a computing power of 8,000 nodes. After being divided into 100 partitions, each partition is equivalent to an independent Ethereum blockchain, and the computing power drops to 80 nodes. Composite computing power.
At this point, one of the partitions is51% Hashrate AttackIt's much easier. After controlling a partition, an attacker can do evil in this partition and tamper with transactions.
The Ethereum Foundation plans to use sharding technology as one of the upgrades of Ethereum 2.0. We will wait and see how Ethereum can solve the above two defects of sharding technology.


