We all know that public blockchains are incapable of scaling currently. And we all have come across the scaling issues that Ethereum has been suffering. So experts have zeroed on two methods that can help the cause of Ethereum – First is layer-2 scaling which means that we can improve scaling using off-chain solutions. Second is to fix the issues by modifying the design of the protocol. Here comes the old friend, Sharding into play.
Why is Sharding?
It is a known fact that if we divide responsibilities, the work can be done more efficiently. Sharding is a similar concept where the entire state of the network is divided into smaller portions called Shards. Each shard is complete in itself containing its own transaction history as well as an independent piece of state. Sharding has been around for a long time and is utilized in a variety of scenarios.
How Sharding works?
Currently, a full node in Ethereum houses a lot of data including contract code, account balances, and other information. If the size would have been small, it would have been easy to manage such nodes. But with an increase on reach of Ethereum at such a terrific rate, it has increasingly become difficult to manage the same.
Nodes lack any special privileges and it has to process every transaction individually. So Ethereum started suffering from high confirmation time and huge gas expenses. The addition of Sharding means that nodes are divided into shards and each shard only processes transactions specific to that shard. This allows multiple transactions at the same time which improves the throughput immensely.
Using sharding, every node will only carry a subset of the data and tends to validate only these transactions. Now, in case, the node requires the transaction information of the blocks that is no carried by it, the node contacts some other node for the required information. This is something that has left the experts perplexed.
Issues in Sharding
Nothing comes without a fair share of issues. The same goes with Sharding. Let us break down some of the issues in Sharding:
Network Sharding – How easy it sounds when we say that the node will be broken down into smaller shards? But in real life, it is not at all easy. Experts need to exercise ample care while allocating nodes to shards so that it remains secure as ever. A consensus protocol like Proof of Work can be a possible solution to this problem.
Transaction Sharding – Another issue with Sharding will be the way transactions will be processed thereafter. If any user requests a transaction, the system should be secure enough that it doesn’t allow multiple processing of such a transaction. An account based system should largely solve this issue.
State Sharding – It is considered as the most difficult issue to overcome. In an account based model, if a transaction takes place between two different shards, it is normal that it will consume more time to process. We must pay attention that such time taken will not overweigh the benefits of sharding. The most reasonable solution to this issue is to reduce or stop cross shard communication but it is not without its share of cons.
The developers at Ethereum are still searching for a simpler solution, opting for ‘off-chain’ transactions is also an area to dive deep. These micropayment channels impart reasonable support without posing any burden on the platform.
Nevertheless, sharding has served well for some platforms but will it serve the same for Ethereum is difficult to gauge yet. It is a challenge to find an easier solution to alleviate this problem and if sharding proves out to be the ultimate solution to this issue, it would be a victory for Ethereum.