On April 7, V God’s website updated an article titled “Why Sharding Is So Good: Uncovering the Mystery of Technical Properties”, which mentioned: Sharding is the future of Ethereum’s scalability. It is the key to helping the ecosystem support thousands of transactions per second and allowing most parts of the world to use the platform regularly at an affordable cost.
As you may also know, a very important factor limiting the current large-scale application of blockchain technology is performance, which is one reason why many traditional Internet practitioners are not optimistic about blockchain technology. So, how to solve the performance problem of the blockchain? One of the solutions is sharding technology (Sharding).
01What is fragmentation?
Fragmentation is a form of database partitioning, also known as horizontal partitioning, which means that a large database is divided into many small, processable parts to improve performance and shorten response time.
Sharding is not a new concept. It appeared in traditional centralized database management as early as the late 1990s. The popularity of this concept is due to Ultima Online, a role-playing game played by multiple players simultaneously.
In this game, the developer assigns players to different servers to relieve traffic pressure (this means there are many parallel “game worlds”). In business, a common fragmentation case is to divide the user information database according to geographic location, and put the user information in the same area together and store it in a separate server.
02What 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 of these nodes can obtain the right to account and produce blocks at a time, and the remaining nodes that have not obtained the right to produce blocks are equivalent to doing “useless work” and wasting computing power.
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.). The nodes of the entire network are also grouped, and each group is at the same time Process a decomposed task (for example, 150 pending transactions), so that from the original single node processing all tasks of the entire network, multiple groups of nodes are processed in parallel at the same time.
For example, suppose that there are currently 8,000 nodes (miners) on Ethereum, and there are 15,000 pending transactions on the entire network. Ethereum can process 7-15 transactions per second. Under normal circumstances, it takes at least 1000 seconds to process these pending transactions. Of course, there will be new pending transactions generated during the processing.
If sharding technology is used to divide 8,000 nodes into 100 groups, each with 80 nodes, these 15,000 pending transactions are divided into 100 partitions, each with 150 transactions, then each group of nodes (80) can be processed in parallel. The pending transactions (150 transactions) in the partition, so that the 15,000 pending transactions can be processed in as fast as 10 seconds.
From this example, we can see that sharding technology can greatly improve the performance of the blockchain.
03 Potential risks of sharding technology
So, is there any flaw in the sharding technology? The answer is yes.
Although the sharding technology can solve the performance problems of the blockchain to a certain extent and make the blockchain more scalable, it also has two shortcomings.
One is the communication problem in different districts after partitioning. In the above example, the Ethereum network is divided into 100 partitions. Each partition is independent, which is equivalent to 100 independent and parallel Ethereum blockchains, each of which is maintained by a group of miners (80 nodes) And confirm the transaction.
These 100 independent Ethereum blockchains cannot communicate with each other. If they want to communicate, it is necessary to increase a cross-partition communication mechanism (similar to a cross-chain), which will increase the complexity of the blockchain and increase the difficulty of development.
The second is the security of the blockchain. Still in the above example, before sharding, the Ethereum network is composed of 8,000 nodes with computing power. After being divided into 100 partitions, each partition is equivalent to an independent Ethereum blockchain, and the computing power drops to 80 nodes. Composition of computing power.
At this point, it is much easier to perform a 51% hashrate attack on one of the partitions. By 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 solves the above two defects of sharding technology.
Author/ Translator: Jamie Kim
Bio: Jamie Kim is a technology journalist. Raised in Hong Kong and always vocal at heart. She aims to share her expertise with the readers at blockreview.net. Kim is a Bitcoin maximalist who believes with unwavering conviction that Bitcoin is the only cryptocurrency – in fact, currency – worth caring about.