Mainnet Technicals: Multi-Layer Scaling, and Multi-Level Sharding | Part 1
Now that mainnet has officially launched, let’s take a quick look back at what technical features are included in TOP Chain. Much of the focus on the TOP Chain mainnet so far has been on sharding. While this is probably the most important and central aspect, TOP does not stop innovating there. TOP Chain uses many scaling techniques that all work together to create a public chain capable of handling the volume of real world applications.
Comprehensive Multi-Layer Scaling Technology
In terms of blockchain scaling, people usually speak of layers. Layer-1 is considered the actual chain, and scaling in layer-1 is called on-chain scaling. The other most commonly talked about layer is layer-2, which eludes to things “above” layer-1.
Most blockchain projects focus just on layer-1 scaling, and look to third party projects to provide layer-2 scaling solutions. For instance, Ethereum is hoping that Plasma will provide layer-2 scaling, and Bitcoin is banking on the Lightning Network for payment channels.
In TOP’s case, we implement all of these layers ourselves. Among other things, this makes it much easier to build a cohesive integrated system since third-parties are not involved. With that being said, let’s take a look into what we call Comprehensive Multi-Layer Scaling Technology.
Layer 0 — p2p Internet
In addition to the more common layer-1 and layer-2, TOP also scales in what we call “Layer-0.” This is the base layer on which TOP Network runs. This “layer-0” is a customized p2p overlay network which has been specifically built to optimize the TOP Network platform, and account for network intensive processes like cross-shard communication. The team’s extensive background in building distributed communications networks is what made this a possibility. Other blockchain platforms typically use or plan to use pre-existing p2p network implementations, which does not allow them to customize and optimize in the same way as TOP.
TOP’s p2p overlay network can be thought of as one big p2p network consisting of many interconnected p2p networks. Or said in another way, TOP’s entire ecosystem is essentially a p2p internet running atop the internet. Using optimized gossip protocols and a hierarchical network structure allows for efficient routing and communications between nodes and sub-networks on TOP Network. More on TOP’s network architecture can be found here.
Layer 1 — Sharding
In layer-1 (on-chain), TOP scales through comprehensive sharding. This includes state, network, and compute sharding. More on this later.
Layer 2 — State-Channels & Service Chains
Finally, TOP provides built in state-channels and service chains. State-channels can increase TPS by orders of magnitude, and since they are built directly into TOP Chain, it makes them much easier to use. There is no need to seek out and integrate a third party solution, and compatibility is guaranteed. The inner workings of TOP’s state channels will be detailed in another article.
TOP also provides service chains, which again greatly increase scalability, in addition to providing increased flexibility. TOP’s pluggable multi-chain architecture can accommodate any type of business or service, and takes some of the burden off of the main chain. Service chains can be used for complex business level logic and/or service transactions, which keeps the main chain from getting congested.
Comprehensive Multi-Level Sharding Technology
Back to layer-1. TOP implements a unique multi-layer sharding design. This paradigm, which we call Comprehensive Multi-Level Sharding Technology, was designed to overcome many of the numerous challenges associated with sharding, and achieve the elusive full-state sharding.
When it comes to sharding, the goal is to achieve linear scalability. This basically means that scalability increases linearly with increasing node count. For this to happen, the amount of work each node must do should not strongly depend on the total number of nodes in the system, or the global volume of transactions.
To accomplish this, all of a blockchain’s resources must be sharded, including state(storage), computation(transaction validation and smart contracts), and networking(block propagation, cross-shard communication etc). If for instance only computation is sharded (i.e transactions and smart-contracts), then state(storage) or bandwidth will eventually become a bottleneck.
To get to a fully sharded system, TOP developed a novel layered sharding architecture. As a general overview:
- Two-Layer State Sharding: State is sharded between Advanced Nodes in clusters, and Validator Nodes in shards.
- Three-Layer Network Sharding: The Consensus Network is split into zones, which are split into clusters, which are then split into shards.
- Three-Layer Compute Sharding: Computation is partitioned between clusters, and shards. Shards themselves are then partitioned into subsets to perform transaction validation in parallel.
Next, we’ll see how TOP developed a highly parallelized form of pBFT consensus along with a layered lattice data structure to further improve scalability. Even implementing just one of these technologies is no simple task, but all are needed to overcome the scalability trilemma.