Why do blockchains need sharding?
The Bitcoin and Ethereum blockchains, the firsts in the world, currently deploy the Proof-of-Work (PoW) consensus mechanism in their modus operandi. This entails the dedication of tremendous computing power towards the decryption of transaction data which involves complex mathematical computations.
Each one of these powerful computing systems on the network is called a node, and the globally scattered nature of their network is what provides the necessary decentralisation to the blockchains.
They also run the necessary security protocols required by the blockchain. The greater the number of nodes, the greater is the decentralisation and hence greater is the security. However, the addition of too many nodes clogs the blockchain network and thus slows down the processing. Blockchains have been facing this classic ‘trilemma’ of simultaneously achieving scalability, security, and decentralisation since their inception.
So, if we need more nodes whilst decongesting the blockchain network, what do we do about the reduced processing speed? Here’s where sharding comes in.
What is sharding?
The philosophy behind ‘sharding’ is the horizontal spread of processing power instead of continuously adding it to one blockchain. But before the blockchain is scaled, we must reduce the amount of computing power required from each node to sustain operations. Therefore, newer blockchains (including Ethereum) are moving to the greener and energy-efficient Proof-of-Stake (Pos) consensus mechanism.
Unlike the PoW system, PoS only requires nodes to devote the blockchain’s native cryptocurrency to the network – a concept known as ‘staking’. The blockchain identifies these stakes as contributors and makes them transaction validators on the network, thus reducing the requirement of computing capabilities. Now that the path is cleaner, curtains open and enter shards.
Shards are sub-chains built over the main blockchain. They can be thought of as branches of a tree – every time a new branch is added, the tree gets bigger. Each shard acts like a mini-blockchain with its own processing power and a dedicated set of nodes. Since the nodes need not access all the data on the main chain anymore, the required computing power is further reduced. This unlocks a greater processing speed on every shard.
Now that we have a basic understanding of how the construction of the system is, let’s get to its method of working.
How does sharding work?
Over and above being connected to the main blockchain, all shards are interconnected amongst themselves and continuously exchange data. Since data from the main chain is fragmented and distributed among the shards, the blockchain declutters, runs all underlying protocols more efficiently, and acts as a decentralised distributed ledger. More nodes can now be added as more blockchain users are onboarded to the blockchain network.
Once the shards scrutinise transaction details, the data is bundled into ‘blocks’ and added in series to the blockchain. Every block is linked to the previous block and can neither be modified nor tempered with upon addition. This concept in blockchain technology is called ‘finality’.
Popular blockchains that use sharding:
1. Ethereum 2.0:
The main chain of Ethereum 2.0 is called the Beacon Chain and runs the new consensus mechanism system called Casper PoS. The Beacon Chain manages the PoS protocol and manages the shards as they keep getting added to the network. A salient feature of Ethereum 2.0 is that every shard has a randomly chosen node called the ‘block proposer’. The role of this node is to trigger the creation of a new block after the addition of each block to the Beacon Chain.
2. NEAR
The primary objective of the NEAR Protocol is to ensure that all nodes are running light client software and that any low-end device is capable of running the protocol. This enables the network to onboard billions of people with access to weaker hardware, something most blockchains are incapable of.
3. Polkadot’s Parachain:
This blockchain uses the concept of ‘parallel blockchains’ wherein a ‘relay chain’ lends its security protocols to every chain it connects to. It also guarantees that the data exchange between shards remains secure. A key feature of this blockchain structure is that all the transactions processed on each of the parallel sub-chains do not interfere with each other. Throughput is multiplied by parallel processing.
4. Shardeum:
The first layer 1 blockchain indigenous to India, Shardeum is a project co-founded by WazirX CEO Nischal Shetty and Omar Syed. It is currently under development and will take on the likes of Ethereum and Solana. According to the official website, Shardeum will feature “infinite scalability, true decentralisation, and solid security.” It will be capable of onboarding 1 billion people and become the foundational infrastructure to build web 3.0 on.
Blockchains have been plagued by the lack of scalability since their inception and Shardeum intends to tackle the problem head-on. Ensuring throughput while handling such large volumes is another challenge that Shardeum will overcome. The whitepaper hasn’t been released but is expected soon.
This is a partnered post.
First Published: IST