This is a free and brief translation of the article (original in English)
Zilliqa is a new blockchain platform that is capable of processing thousands of transactions per second. Thus, Zilliqa has the potential to compete with traditional payment systems (such as Visa and MasterCard). Moreover, the speed of transaction processing increases approximately in proportion to the growth of the network.
This article focuses on the concept of sharding, which is used in Zilliqa to provide scalability. Sharding in Zilliqa is used in different aspects of the system: network sharding, transaction processing sharding, and distributed computing sharding.
What is sharding?
< p> So, sharding is a mechanism that allows you to divide the Zilliqa network into small groups called shards. Imagine that the network consists of 1000 nodes. Then you can divide the network, say, into 10 shards of 100 nodes each.It is thanks to this mechanism that Zilliqa has such high throughput. Shards process information in parallel. Let's say, if one shard can process 10 transactions per second, then our network of 10 shards will be able to process 100 transactions in the same time. Thus, as the network grows, its power will also increase.
The idea of sharding is not new and is used in databases to improve productivity. But the idea of using sharding in the blockchain appeared relatively recently, in 2015, in collaboration with the Zilliqa team.
Is that all? It sounds simple!
The idea itself is simple, but its implementation in practice is quite difficult. Below are the main problems that need to be solved to apply the sharding mechanism:
1. Protection against Sybil attacks. Since Zilliqa is a public platform, anyone with a working computer can become a member. On the one hand, to ensure the operation of the blockchain, a sufficient number of nodes is necessary. On the other hand, it is necessary to protect the system from malicious actions and so-called Sybil attacks.
2. Creating shards. It is necessary to develop a mechanism for dividing nodes into shards, and also to determine who exactly will decide which shard a particular node will fall into. This cannot be done by the Zilliqa team, because the team could hypothetically compromise security in Zilliqa by placing “dishonest” nodes in the same shard.
3. Shard size. Is it possible to create tiny shards, say 10 nodes in size? Of course not, because the smaller the size of the shard, the easier it will be for scammers to take control of it. Moreover, these same shards are used to process transactions, so a small number of nodes per shard is absolutely inapplicable in this case.
How does Zilliqa combat these problems?
1. Controlling Sybil Attacks. There are several ways to prevent Sybil attacks or make them economically unviable. For example, nodes can deposit cash or tokens as collateral. Or you can ask them to perform calculations, as in the PoW mechanism. Zilliqa also uses PoW - each new node must perform a series of calculations before starting to work on the network. Previously added nodes check the result of calculations and issue authorization. Thus, PoW serves as a kind of entrance ticket to the network.
2. Automated creation of shards. Using the PoW protocol allows you to automatically create shards. Zilliqa selects a special group of nodes. The choice is made based on PoW. After a certain time interval, one of the members of this group is replaced by a new member (the “first in, first out” principle is used). This way the number of participants in the group remains constant. The node that performed the calculations the fastest becomes the new participant. This group initiates the sharding process. Then all nodes perform new calculations according to the mechanics of PoW, and based on these calculations, each node is assigned to a certain shard.
3. Selecting the correct shard size. This task is critical to maintaining system security. Let's assume that there are 1000 nodes in the network, of which ¾ (750) are honest, and the remaining 250 nodes are fraudulent. Now let's create shards of various sizes and calculate the probability that at least a third of the nodes in one shard are fraudulent. As can be seen from the figure, the probability of this is high with a shard size of 100 nodes. Since consensus requires the presence of an overwhelming majority of “honest” nodes, the size of the shard must be increased. With a size of 600 nodes or more, the probability drops to one in a million. This is why Zilliqa decided to set the minimum shard size to 600 nodes.
As mentioned earlier, sharding is also used in transaction processing . Each shard processes transactions independently, ensuring fast network operation. As soon as a transaction enters the network, a specific shard processes it. The distribution is based on the first characters in the transaction number.
Finally, sharding allows for computation and efficient use of smart contracts. For example, some shards can perform map functions, others can perform reduce functions, performing distributed calculations.
Conclusion
Despite the above steps, there may still be fraudulent nodes present in the shard. Thus, it is necessary for the system to continue to operate efficiently and generate blocks even with a small number of fraudulent nodes.
Summary
Zilliqa is a new blockchain platform that can process thousands of transactions per second, thus potentially moving closer to Visa and MasterCard.
To do this, the platform uses sharding, which in Zilliqa is represented by network sharding, transaction processing sharding and distributed computing sharding.
The main problems of sharding are the following: protection against Sybil attacks, the process of creating shards and determining the size of the shard. Zilliqa combats these problems by using PoW to authorize nodes, automatically creating shards by a specially selected group of nodes, and setting a minimum shard size of 600 nodes.