Halborn Logo

// Blog

What Is Sharding?


profile

Rob Behnke

January 2nd, 2023


Sharding is dividing a blockchain into multiple pieces with individual attributes. Sharding solves the problem of scalability, a consistent problem with blockchains. To better understand the function of sharding for blockchain and why it is important, let’s first take a look at the Blockchain Trilemma. 

The Blockchain Trilemma

In blockchains, there is a problem of balancing the security, scalability, and decentralization of the chain. Trying to improve one of these ends up declining the other two.  That is called the Blockchain Trilemma.

Decentralization can work as long as there are enough nodes that have all the records of the digital ledger.

However, as the data storage and the utilization of the blockchain rises and it grows in volume, there is also the problem of keeping the transaction speed steady to make the blockchain adaptable to an increasing quantity of transactions. 

C:\Users\Alp\Desktop\1_UWlj5oOU7K9zOl87aQDmlg.png

The problem is that, in Proof of Work, after a block is made, the information of the new block has to be updated by each miner. But there are thousands of nodes to be updated and confirmed with the adaption. This consumes time and energy.

This is where sharding comes in, increasing scalability in the most effective way with minimized cons.

What is sharding in blockchain?

Sharding is a database distribution technique that aims to improve the scalability of blockchain systems.  And, in theory, sharding gives blockchain the potential to scale infinitely, minimizing the latency for good. 

Since the nodes need to process less data rather than keeping the whole ledger, it makes the consensus more manageable and keeps transaction speed steady. Ethereum 2.0 is one of the first to use this scaling method and is planning to divide itself into 1+63 shards.

After separation, each blockchain will have its own smart contracts and specific attributes. These will make these shards distinguishable and authentic compared to other shards. Thus, when a transaction is made, the nodes will know which shards are involved in the recording of the transaction. 

C:\Users\Alp\Desktop\The-sharding-technology-partitions-the-network-into-different-groups-while-each-of-the.png

Sharding is a complicated process that has to be carefully planned as it is often not possible to reverse sharding due to its usefulness and ongoing need.

Why is sharding necessary?

Ethereum Blockchain allows for around 40 transactions per second. This transaction speed is much less than some other conventional transaction systems. For example, Visa can allow 24,000 transactions per second.

In Ethereum 2.0 Blockchain, people can add bids to get their transactions processed ahead of other pending transactions. This bidding cost can be as high as $50, meaning that if you wanted to send $20 worth of an asset on Ethereum, you would have to pay $50 dollars. This limits the logical use of the blockchain as it would be highly impractical to use the blockchain for small transactions. The low number of allowed transactions also causes latency and, in a situation where a transaction has to be imminent, latency can cause a variety of problems.

A good analogy to understand sharding

Imagine blockchain as a highway that allows a certain amount of cars to travel on it in a second. As the city gets more crowded, the vehicles using the road will increase and after a certain time, this will cause traffic, turning a 20-minute long drive into an hour-long drive.

Sharding comes into play at that point. To take care of the traffic, parallel roads can be built with the same transaction capacity as the first road. The number of shards (added roads) will end up reducing the traffic.

Cons of sharding

There are several cons – or disadvantages – to sharding, including:

  • As blockchain will get separated into multiple tinier pieces, it will increase the possibility of successful hacks, cyber-attacks, and 51% attacks on shards. Shard takeovers are events where an adversary has gained control of the shard and can register transactions freely.
  • Sharding a blockchain should be seen as a permanent solution as the need for scalability of transactions will probably remain permanent, as the need for it is generally only expected to grow.

CONCLUSION

To summarize, sharding is the inevitable route for exponential growth in blockchains. Solving the blockchain trilemma with minimized cons and allowing blockchains to compete with the speed of centralized entities, sharding is here to stay and will further expand into the future of blockchain.

© Halborn 2024. All rights reserved.