Sharding 101: I Know What You Did Last Summer

Concordium
Concordium
Published in
4 min readApr 28, 2020

At its core, the Blockchain is a database. However, unlike the traditional database, the Blockchain is a decentralized ledger where each node stores and maintains a copy of the network’s record. Data is processed and stored using unique signatures that must first be verified before being added to the chain. However, with every node processing transactions, executing smart contracts, and adding blocks, the network may find itself growing too big for its own good — its head growing too big for the neck, a bottleneck.

Gossip Folks

Alice just transferred eight tokens to Bob. The transaction was validated by Node E, so how did Node T get to know about the transaction half a world away? Simple. Node S dished the dirt thanks to Node R who got the goss from Q shortly after Q got it from P, who got it from O, N, M, all the way down to F who was the closest to E.

Copyrights: Tiaan Wolmarans and Hakernoon

Nodes are gossip-monger. Nothing happens on the network that wouldn’t get propagated from one end to the next. They never stop gossiping with each other about the other’s activity.

However, just because a node says something doesn’t make it true to the node being told.

For every gossip that comes a node’s way, the node will have to recalculate the event to make sure it’s the truth. Having arrived at the truth, the node proceeds to tell the next node what it heard and confirmed, however, this new node will also have to redo the variables to verify the sequence of events for itself. A million nodes later, your frappuccino transaction is still being gossiped about and recalculated, while Starbucks waits for the transaction to be confirmed.

The linear nature of the Blockchain consensus is a double-edged sword. On the one side, you have a strength akin to a broom that gets harder to break the more you add to it. On the other side, as more nodes get added, the time it takes for the network to reach consensus lengths due to nodes having to verify the truth. As the network grows and traffic increases, so do the transaction time, hamstringing adoption.

What if the Blockchain can be split into partitions, each partition uniquely responsible for all interactions within while still capable of communicating with other partitions in order to interact with their unique feature.

One partition could be responsible for off-chain data oracles, while another may host transactions for exchanges, a third may deal exclusively in non-fungible token (NFT) transactions, while a fourth may only be responsible for storing the state of the Blockchain. This system will not only enable the Blockchain to specialize transactional output, but it will also be able to run parallel transactions at the same time without thereby increasing throughput.

This system is sharding.

Shard Up!

Sharding breaks up large databases into more manageable chunks, improving throughput and performance. With each shard responsible for its own unique set of operations, sharding brings unparalleled specialization for nodes, allowing them to dedicate their resources to operations within their purview rather than getting up in other folk’s business.

Copyrights: Tiaan Wolmarans and Hakernoon

Partitioning a Blockchain into autonomous segments is not without its problems. Each shard can be regarded as a Blockchain in itself making it impossible for users on one shard unable to interact with users on a different shard without the aid of a cross-shard communication protocol. However, the biggest problem comes from the fragmentation of the network’s custodians, making it easy for attackers to concentrate on taking over a single shard. Also known as a 1% attack, an attack may only need 1% of the total amount of resources required to take control of the Blockchain to control a shard 100%.

Once in control of the shard, the attacker controls all transactions on the shard, able to send malicious transactions to the Mainnet with no way to verify their true origin.

Randomly assigning validators and rotating leadership per epoch greatly mitigates the risk of such happening. However, the possibility of this scenario happening increases as more shards are added to the network.

Islands in the Sun

Concordium’s finality layer checkmates this problem through its 2-layer consensus approach, combining a Nakamoto-style Consensus Blockchain with a novel finalization method for fast finality and security.

Concordium uses a control chain to spawn shards. Each shard runs as an individual Blockchain using the finality-as-a-service (FaaS) component of the control chain to finalize transactions.

Finalization on any shard is executed by nodes on that shards alongside the elected finality committee on the control chain.

The control chain keeps track of all finalized blocks across shards. It runs a full-fledged 2-layer consensus mechanism ensuring that as long as corruption remains below ⅓, blocks are finalized as soon as they are validated.

However, if corruption is between ⅓ and ½, the network accedes to the consensus of a pure NSC Blockchain whereby the attack will also need to own 51% of the network’s control chain.

Concordium will implement its sharding solution to release a real scalable solution for Businesses, Public Institutions and individuals.

--

--

Concordium
Concordium

Concordium with its Zero-knowledge ID enables the creation of regulation-ready dApps balancing decentralization, security, scalability, and regulation.