Ethereum Sharding: The demand for scalability is becoming increasingly urgent. The Cryptokitties incident demonstrated how quickly the Ethereum network can clog-up. While many in the community are excited for Ethereum’s Sharding, there are just as many who struggle to understand how sharding will help Ethereum scale.
In this post, I will attempt to explain Ethereum’s sharding using a simple analogy.
Understanding The Problem
One of the major problems of a blockchain is that an increase in the number of nodes reduces it’s scalability. This may seem counterintuitive to some people. “More nodes = more power. So more speed, right?” Not exactly.
One of the reasons a blockchain has its level of security is because every single node must process every single transaction. This is like having your homework assignment checked by every single professor in the university. While this may ensure that your assignment is marked correctly, it will also take a really long time before you get your assignment back.
Ethereum faces a similar problem. The nodes are your professors. Each transaction is your assignment.
Sure, we can reduce the number of professors (nodes) until we are satisfied with the speed. But as the assignment (transaction) backlog increases, we will need to further decrease the number of professors. This will eventually lead us to rely on a few “trusted” group of professors. A centralized group.
This defeats the ideology of blockchain decentralization. It’s much easier to compromise/corrupt a smaller group of professors (nodes) than the entire university (the entire network). As a result, we sacrifice security in an effort to scale.
To sum it up, blockchains must choose between Two of the Three following attributes:
What is "Sharding"?
With the problem and limitations understood, we now pose a question:
Can we have a system that has sufficient number of “professors” (nodes) to still maintain the security – while being small enough to increase the speed at which your assignments are returned (throughput of the network)?
Essentially, we are conceding that we can’t “max-out” on all three of the attributes: Scalability, Security, Decentralization. But, can we have just “enough” decentralization & security so as to achieve more scalability?
Sharding is Ethereum’s answer to this question.
Ethereum Sharding: Think of Sharding as simply a fancy way of saying, “let’s break down the network into smaller groups/pieces”.
So in our professor analogy, a shard would consist of a group of professors and assignments. Now, instead of a professor having to correct the assignments across the entire network, he would be only responsible for the assignments within his shard(group).
This greatly reduces the number of transactions (assignments) each node (professor) has to validate.
Ethereum Sharding - Structure
Okay, so I may have oversimplified a tiny bit. But now that you understand the gist, you’ll understand this part a lot easier.
In each shard/group, we have nodes that are assigned as “Collators”. Collators are tasked with gathering mini-descriptions of transactions & the current state of the shard.
In our analogy, you can think of Collators as Teacher’s Assistants. All the TA’s in shard/group do the first run through of all the assignments within the shard.
Finally, we have super-nodes. Each super-node receives the collations created by the collators of each shard. They then processes the transactions within those collations. Furthermore, they maintain the full-description/state data of all the shards – which they get from the collators as well.
You can probably see the benefits of this structure. The number of nodes that process every single transaction would be greatly reduced, and thus increase overall throughput.
Sharding is a smart approach to tackling the blockchain scalability problem. However, it’s not without its drawbacks. Because of its structure, it’s easier to compromise a shard within the system.
This is one of the driving reasons behind Ethereum’s switch to Proof Of Stake. Proof Of Stake helps mitigate this security vulnerability that comes with Sharding. But for the sake of brevity, we will discuss that in a future post.
Did you enjoy this post?
Help Us Keep Doing What We Do Best!
Tip Jar 🙂
Get my upcoming eBook for Free!
"The Mango Guide TO Understanding Blockchain"
Offer Valid For FIRST 500 registrations only