Crypto Sharding: Everything to Know
By Beluga Research June 15, 2023
Summary
- Sharding is a technique used to improve the growth potential of blockchain networks
- This involves breaking down the blockchain into smaller, more manageable pieces called shards
- Each shard contains a subset of the entire blockchain - the breaking of the blockchain into "shards" allows for parallel processing of transactions
- Sharding increases transaction throughput, reducing the time required for blockchain transaction confirmations
Overview
Sharding in crypto works by dividing a blockchain network into multiple "shards," each with its own set of validators or nodes. Each individual validator is responsible for validating and processing transactions within their respective shard. This breakup of the network into small pieces allows the network to handle more transactions simultaneously. Thereby increasing the network's overall capacity.
Sharding ensures the security of the network by requiring each shard to be cryptographically linked to the others. Together, the shards form a single, cohesive blockchain. The cryptographic links require each transaction to be validated and confirmed by multiple shards. This makes it difficult to manipulate the network as a whole.
In contrast, a traditional blockchain without sharding remains intact. All nodes in the network process every transaction that occurs. As the network grows, the number of transactions that each node must process increases. The growth of the network means that nodes' processing times become increasingly slower.
A Brief History
Vitalik Buterin, a co-founder of Ethereum, first introduced the concept of sharding in a 2014 paper. He proposed a sharding solution for Ethereum, which would increase that network's scalability and processing speed.
Even though sharding was on the Ethereum roadmap for a long time, and was once intended to be implemented before The Merge to proof-of-stake, it has yet to be utilized. With the rapid development of layer 2 rollups and the invention of Danksharding (adding blobs of rollup data to Ethereum blocks that can be efficiently verified by validators) has led the Ethereum community to favor rollup-centric scaling instead of scaling by sharding.
Still, many other blockchain projects, particularly in the realm of decentralized finance (DeFi) and blockchain-based platforms have implemented sharding to improve the performance of their networks.
What Is Sharding?
Sharding is the division of a blockchain network into multiple shards. The network is made secure by cryptographically linking each shard to the others. Together, the shards form a single, cohesive blockchain. Every transaction is validated and confirmed by multiple shards. That way it is difficult for a malicious actor to manipulate or attack the network.
Each shard has its own set of validators or nodes. The validators are required to validate and process transactions within their respective shard. The network is then capable of handling more transactions simultaneously.
One of the advantages of sharding is that it allows for horizontal scaling. A network can handle more transactions by adding more shards. The process of horizontal scaling, adding distributed workloads, is different from vertical scaling. Vertical scaling involves increasing the processing power of individual nodes. Vertical scaling can quickly become expensive and impractical.
Getting Started
- Divide the network. Sharding divides the network into small pieces.
- Process a subset of total transactions. Each shard is responsible for processing a subset of all the transactions on the network.
- Increase security. An attempt to modify even one shard of a blockchain will be detected by the other shards.
- Cut transaction times. Each node processes a small, limited amount of transactions, rather than an increasing workload as the network grows.
- Increase scalability. The network is more scalable because of the faster transaction times.
- Handle more transactions. The community accomplishes this by adding more shards.
- Run on less powerful hardware. Since each shard must only process a fraction of the total transactions, less processing power is needed for each node.
Unique Aspects
Security. With sharding, each shard only maintains a copy of the transactions that occur within that shard. Since each shard is connected to the rest of the network, an attempt to modify the blockchain within a single shard will be detected by the other shards. This would cause a rejection of the modified version of the blockchain.
Contrast this with a traditional blockchain network. In this system, all nodes in the network maintain a copy of the entire blockchain. A malicious actor that wants to alter the blockchain must modify every copy of the blockchain on every node in the network.
Efficiency. Each shard must only process a fraction of the total transactions. The processing power required for each node is significantly reduced. As a result, nodes can be run on less powerful hardware. When more nodes can run on less powerful hardware, the community experiences lower costs and can increase access.
Advantages
- Scalability. Sharding addresses scalability by allowing blockchain networks to process a significantly higher number of transactions per second. This is achieved by breaking down the network into smaller partitions that can process transactions in parallel.
- Lower Fees. With sharding, the cost of processing transactions can be significantly reduced. The increased transaction throughput reduces competition for block space. This in turn reduces the fees that users pay to have their transactions processed.
- Faster Confirmation Times. Sharding has the potential to significantly reduce the confirmation times of transactions. This is because transactions can be processed in parallel across the shards. Such processing lowers the overall confirmation time for a transaction.
- Reduced Resource Requirements. Sharding allows a community of users to reduce the resource requirements of running a node on a blockchain network. Sharding allows nodes to store and process a subset of the transactions on the network. This reduces the storage and processing requirements of running a node.
Disadvantages
- Complexity. Sharding adds significant complexity to blockchain networks. Shards must be managed and coordinated in a way that ensures that they remain secure and decentralized. This requires significant changes to the consensus mechanism and the network architecture. The changes can introduce new vulnerabilities and attack vectors.
- Shard Attack Risk. Sharding introduces new security risks to blockchain networks. Shards are less secure than the main network. A successful attack on a shard could compromise the security of the entire network. A malicious actor could attempt to manipulate the shard selection process. Then the actor could gain control of a majority of the shards. This would compromise the security and decentralization of the network.
- Network Fragmentation. Sharding can lead to network fragmentation. This means that different shards would operate independently of one other. The phenomenon can lead to a loss of network effects. It can also result in reduced interoperability between shards.