Emotiq’s Sharding: What It Is and How It Works

Emotiq
Emotiq
Published in
4 min readSep 6, 2018

Originally published at emotiq.ch.

As blockchain becomes more popular, it continues to struggle with the high amount of data thrown at it. This ability to process data is called scaling, and it is crucial to wide blockchain adoption. Blockchains need to scale for people to build and use the applications they want.

Sharding is an innovative approach that will help blockchains scale and process transactions. Emotiq is building a blockchain on the foundation of sharding and aims to scale to a million transactions per second.

To understand sharding, we need to understand the difference between Proof-of-Work (PoW) and Proof-of-Stake (PoS). These are two blockchain mechanisms used to securely decide what block becomes the next one to extend the chain. We will explain why Emotiq chose PoS over PoW and why PoS is better for building a high-performance blockchain.

PoW is older and used in cryptocurrencies like Bitcoin (BTC), Litecoin (LTC), and others. PoW is a system where miners — nodes in the blockchain network — use their computing power in a race to solve a difficult math puzzle and earn a reward for creating a new block. The greater a miner’s computing power, the greater their chance of winning the race and earning the reward.

What secures a PoW blockchain is the sheer amount of computing power required to solve the math puzzle for each block. PoW fails if malicious miners control a majority of the total computing power of the network, resulting in a 51% attack.

PoS is newer and works like a lottery. Participants place cryptocurrency deposits into escrow during a process called staking in order to have a chance to win the lottery and collect rewards. The rewards are usually fees from transactions in the new block, as well as a reward for creating the block itself.

A new lottery round happens often, and the winner is chosen randomly. The larger a participant’s stake, the greater their chance to win the lottery. Staking helps keep participants honest. If a participant is dishonest and validates fraudulent transactions, then they risk losing their stake.

PoS is as secure as PoW since a participant with a large stake will have a large incentive to act in the best interest of the blockchain while helping maintain it.

Sharding is dividing the blockchain network into smaller groups of nodes, called shards. Each shard handles a chunk of blockchain data and is only responsible for validating the transactions that touch their data, instead of the entire blockchain. Nodes in the shard download the part of the blockchain that corresponds to their shard.

The nodes process and confirm transactions and maintain the blockchain’s consistency. They are randomly distributed across shards, and their shard assignments are changed periodically. The random assignment reduces the likelihood of sophisticated attacks. It ensures that an attacker cannot place an overwhelming number of malicious nodes in a single shard.

The benefits of sharding include greater scaling because the number of nodes needed to verify every single transaction in the network decreases. That greatly increases the blockchain’s throughput, or processing efficiency. The total number of shards must be kept at an optimal number, to prevent communication between shards from drastically slowing down the network.

Sharding is not suitable to PoW. That is because PoW relies on computing power to confirm and secure the blockchain. If sharding is attempted with PoW, then the computing cost of attacking a shard will require just a fraction of the computing power needed for a 51% attack.

PoS does not rely on computing power and solving math puzzles, and can easily adopt sharding. The number of shards in the network as well as the blockchain’s performance can grow indefinitely. Also, each shard can process transactions in parallel with others.

The size of each shard has to be large enough to prevent an attacker from easily compromising more than a third of the nodes in a shard. The size of each shard must also be kept small enough for performance. Research shows an optimal number to be around 600 nodes per shard.

Attackers find it difficult to compromise a single shard since nodes are randomly and frequently shuffled between shards. Due to the random shuffling and assignment, attackers cannot choose the shard they want to validate.

And they cannot know which shard they will validate in advance. As long as the minimum stake is high enough, sharding with PoS is a highly secure approach to scaling a blockchain.

In conclusion, blockchain’s greatest challenge is how to solve the scaling problem while preserving decentralization and security. Emotiq is solving this problem through the innovative path of PoS with sharding to reach a million transactions per second and beyond.

To get concise updates about how Emotiq is making blockchain user friendly and natural, join our mailing list.

--

--