What Is Ethereum Sharding

Olga Shirimova
April 28, 2020

Most crypto users have heard the term “sharding” many times in connection with the EHT network development. Nevertheless, few non-specialists can answer the question “What is Ethereum sharding?”
Read on to know what sharding means for the ETH blockchain and what problems it addresses.

The Ultima Online (UO) role-playing game made the word “shard” widely popular.

What Is Ethereum sharding: Definition and Basic Explanation

Sharding (or horizontal partitioning) refers to dividing a blockchain into many smaller segments. These segments are called “shards”. The term became popular due to the game Ultima Online, where players were split across different servers, thus creating separate “shards of reality”. These shards shared the same rules and game logic but had different player populations. The purpose was to cope with the massive traffic.

Explained simply, the Ethereum sharding looks like splitting a mainland into many islands. In this blockchain archipelago, all islands are both independent and interconnected. Each of them has its own inhabitants, doing their own things. Shards can contact the main chain and each other through a special protocol.

At this point, you probably wonder why the Ethereum network wants to break down into many segments. Why an archipelago is better than a continent? The shortest answer would be “Scalability”.

Scalability problem: there are many solutions apart from sharding. Image source: Master the Crypto

Ethereum Scalability: Overview

As you probably know, scalability is one of the biggest challenges blockchain networks face today.

The term refers to the ability of a network to adapt to a bigger workload or added resources. If a blockchain network is not scalable, it won’t be able to cope with an increased number of transactions or dApps, without compromising security and other good things.
Therefore, poor scalability is a major barrier the tech should break on its way to mainstream adoption.

Each device runs a full node that requires around 1Tb. Image source: Albert Lin

ETH Nodes: What’s the Problem

Before we dive deeper into this sharding issue, let’s explain what nodes are and what role they play in the ETH network functioning. Nodes are devices that store a full or light version of the blockchain. Full nodes are important for validating and adding new blocks. Miners normally run a full node.

To run an Ethereum node, you need 1Tb of storage space on your computer. It’s too much for a regular user. Under this scenario, if the system keeps growing, soon it will rely on a relatively small number of “supercomputers” for its operation. Such a situation undermines the network decentralization and increases the probability of the so-called “51% attack”. When a person or a group of people concentrate over 51% of the total hash power in their hands, they can take control of the network they belong to.

The blockchain scalability trilemma: currently, it’s hard to balance decentralization, security, and scalability. Image source: Logos

Ethereum Scalability: Possible Solutions

Right now, each member has to store a full version of the ETH blockchain. It creates the problems we mentioned above and slows down the development of the system. If the developers want the community to grow and more Ethereum-based applications to appear, they need to increase the capacity of the network and improve its scalability.

There are three ways to address this problem:

  • increasing a block size;
  • creating several separate blockchains;
  • sharding.

Increasing a block size can improve the performance of the network but it leaves the centralization issue unresolved. In this case, all the nodes will still be making the same calculations. Besides, with a block size increased, this task will require more computational resources than now. Running a node will become even less affordable for a regular person. Therefore, the power will concentrate in the hands of a limited group of well-equipped and wealthy users. There is another risk, too. If some network participants don’t agree with this change, it will split the community and provoke a hard fork. So, increasing block size is rather a short-term fix than a sustainable solution.

Creating several blockchains allows to distribute the apps across different networks and thus avoid overloading one system. However, it may compromise security as smaller networks are always easier to hack or take control of.

Finally, there is sharding. It’s the most complex solution that presents many challenges for the network founders and developers. Sharding cannot be realized in a day and should be done step by step, with a lot of testing on the way. The first important step will be switching from the PoW to the PoS protocol.

Two consensus protocols compared. Image source: Hackernoon

Sharding and Proof-of-Stake

Sharding is only possible when the Ethereum network shifts to the Proof-of-Stake method. Right now, Ethereum uses the PoW protocol, just like Bitcoin. (If you want to know more about both systems, we examine the topic in more detail in this guide).

Long story short, the PoW method means that miners have to spend a lot of electricity and buy expensive hardware, especially if they deal with an older network. The probability of solving a block and getting a reward depends on the amount of work your machine does. PoW ensures a high level of security, but wastes a huge amount of resources, too.

The PoS model works differently. To validate a transaction, you don’t have to spend your computational resources for solving a math puzzle. Instead, you are holding some of your cryptocurrency in the system to support its work. The bigger is your stake (the amount you hold), the greater is your “mining power”. But if the transaction you validated turns out to be bad (invalid), you lose some of the coins you staked.

Now, we let’s see how it applies to sharding.

Payments with sharding: distributing transactions. Image source: Zilinga

How Sharding Works

Within a shard (subdomain), we use “notaries” to confirm the validity of blocks. These validators are selected in a random manner. Their votes are then reviewed on the side of the main ETH chain and added to “collations” (shard blocks). Collations contain the info about what shard they belong to, the state of account balances, etc. They are linked to each other just like blocks in a standard blockchain.

Each shard is connected to the main ETH chain cryptographically. At the same time, these islands live their own lives and their users can transact only with each other. 

The original idea was to split the network data across many segments, each shard processing its portion of this data. Imagine that all the addresses starting with 0x00 would go to the Shard 1, the ones starting with 0x01 would go to the Shard 2, and so on. Therefore, it won’t be necessary for a node to process all the transactions in the network. Instead, it will be assigned to certain shard and deal with its transactions only.
In this way, the workload is distributed and the capacity of the system increases.

Ethereum Sharding: Main Challenges

In theory, sharding looks like a perfect solution, but there are many challenges. 

Changing to PoS and Related Issues 

First, it would be necessary to move to the PoS protocol. According to the updated road map, after Phase 0 is launched ETH 2.0 will start as a separate PoS system. It will function for some time in a test mode, with no apps and few validators.

Sharding will emerge under Phase 1 of ETH 2.0. At first, there will be only 64 shards and the Beacon Chain to coordinate their work. To act as a validator, you will have to stake 32 ETH. As soon as the system has proved fully workable and secure, the transition will begin.

Currently, some users worry that the new PoS system will reward the rich for having money and it’s unfair. The guys from the Ethereum Foundation argue that it’s fairer than the PoW model. In both cases, you have to spend resources to get a reward, but staking makes the process more direct and cost-effective.

How Beacon Chain and shards interact. Image source: Ethos.dev

Communication Issues

If the Ethereum system splits into separate segments, It will be impossible for users from one shard to communicate with users from another shard without applying a special protocol. This is an additional headache for the Ethereum developers. Besides, the system introduced to facilitate things becomes more complicated.

“1% attack” in action: one small shard is easier to take over. Image source: Coinmonks

Security Risks  

Finally, every segmented system faces security problems: it’s much easier to attack a shard than a whole network. A hacker needs much fewer resources for it.

There are talks about the so-called “1% attack”. A malicious user takes over a single shard and then this bad shard submits invalid transactions. The developers suggest the problem may be solved by selecting notaries (shard block validators) at random.

What Is Ethereum Sharding: Perspectives 

If the Ethereum developers manage to overcome all these challenges, sharding may reconcile security, decentralization, and scalability. Thus, this solution has the potential to speed up the mainstream adoption of the technology.

Latest news