Scaling the Blockchain — Layer 1 & 2 Techniques Meet
Public blockchains, such as Ethereum, need to be able to scale in order to reach their ambitions of being recognized as viable alternatives to traditional systems, which, in turn, will allow them to gain widespread adoption and application.
These scaling solutions can be ‘built into’ the blockchain itself (layer 1 solutions) or ‘built on top of it’ to take some strain off the base chain (layer 2 solutions). These two solution categories will likely be complementary to each other.
A brief introduction to blockchain scalability
Although people are becoming aware of the vast potential and many applications of blockchain technology, there are numerous hurdles in the way of public blockchains before they can achieve these ambitions. The most prominent problem is the scalability of the blockchain.
Scalability is defined as the capability of a system, network or process to handle a growing amount of work, or its potential to be enlarged to accommodate that growth. Although scalability is an assortment of challenges in the context of blockchain, the discussion mainly revolves around the network’s transaction throughput. This is evident from the recent spotlights on Ethereum, which have focused on the network’s speed during times of congestion — predominantly caused by events such as initial coin offerings and games revolving around non-fungible tokens.
Layer 1 techniques
One of the approaches for scaling these platforms is through modification of its base protocol, or ‘layer 1’. Due to their direct nature, these changes are generally enacted through a hard fork.
An example of a layer 1 solution for Ethereum is ‘sharding’, which solves the ‘one-track’ issue bottlenecking the network. Currently, every node has to process every transaction in sequence, limiting the network’s transaction throughput to the maximum that can be processed by each node. By splitting the chain into segments — or ‘shards’ — this limit is lifted, as each node can then process different transactions in parallel with each other.
Research and development work for sharding technology is currently spearheaded by the Web3 Foundation with the release of the Kusama canary network — a Polkadot experiment.
Polkadot: the heterogeneous multi-chain
Polkadot is a heterogeneous multi-chain framework that empowers blockchain networks to work together under the protection of shared security.
In addition, there is a framework to create blockchains called Substrate. Currently, Polkadot itself and parachains are created with Substrate. Hopefully, In the future, we think blockchains will be paralleled simply because there is no single perfect blockchain which supports all governance models and customer’s needs by itself. Hence there are more than 900 public blockchains have been built and more and more blockchains are being created. Polkadot and Substrate empower this movement of creating the perfect custom blockchain based on the user’s need.
Interoperability is one of the scaling solutions. Polkadot provides transactional scalability by spreading transactions across multiple parallel blockchains, known as parachains (shards).
(i) Substrate Runtime Module Library (SRML)
Substrate and the coinciding runtime modules are developed with Rust, a statically typed language that offers speed and reliability with its memory safety features.
These packages of functionality are called modules, or more specifically, Runtime Modules. This range of Runtime Modules that come pre-packaged with Substrate collectively form a catalog of modules, called the Substrate Runtime Module Library, or SRML.
These modules are extremely useful. They add functionality for a range of features we’ve come to expect from other Blockchain frameworks, and they’re available to browse through on Github. Having these modules readily available saves developers from reinventing the wheel and re-implementing them — and where entirely new features are implemented, they too can be developed as Runtime Modules.
The SRML modules have been maintained as Substrate has been developed, also making them reliable. Reliability is another key advantage of Runtime modules — maintaining them becomes more realistic as they gain adoption.
Layer 2 techniques
Changes to the base layer of a blockchain can be incredibly difficult to execute, as the integrity and security of the protocol are paramount to its success. Due to this sensitivity, layer 2 solutions are also being developed which will complement the layer 1 methods in providing a scalable and efficient blockchain.
There has been extensive research into layer 2 solutions since the initial concepts of State Channels — including Raiden, Counterfactual, and Bitcoin’s Lightning Network
Plasma is also a layer 2 solution for Ethereum that provides a framework for building ‘off-chain’ decentralized applications that are secure, scalable, and swift. There are numerous implementations of Plasma, including:
1. Minimal Viable Plasma (MVP)
2. More Viable Plasma (MoreVP)
3. Plasma Snapp
4. Plasma Cash
5. Plasma Debit
6. Plasma Bridge
Among all layer2 solutions, Plasma is the only scaling solution that is the least dependent on the processing performance of the main chain. In Plasma, an operator manages its side-chain without sacrificing decentralization. This implies that many transactions can be handled in a centralized way that does not require a consensus process but all participants on the side chain can safely exit by submitting fraud proofs.
The scaling solutions used in the existing centralized systems can be used as they already are. Hence making it possible to achieve high processing performance that is not feasible with a native distributed ledger. Plasma would be recognized as an indispensable technology in the future because it can dramatically improve processing performance for all distributed ledgers.
Plasma is however not Ethereum’s only proposed layer 2 solution and can be reasonably expected to coexist with — and, as with layer 1 solutions, complement — the other layer 2 solutions.
Layer 2 solutions are no changes to the base protocol, but rather constructions built on top of it to allow operations to take place ‘off-chain’, while still retaining the benefits provided by the main chain, i.e. security and finality.
An obvious benefit to layer 2 solutions is that a hard fork is not necessarily required for their implementation, but their scope is far larger than integration concerns; along with layer 1 solutions, they can dramatically improve the practical application and usability of the ‘base’ blockchain.
(ii) Optimistic Virtual Machine
The Optimistic Virtual Machine was invented by the Plasma Group from the Ethereum Foundation. OVM is the virtual machine designed to support all layer2 protocols. It is a possible unification of all layer2 scalability constructions.
Plasm
Even though the Polkadot ecosystem, is itself a scaling solution, we need layer 2 techniques to further scale individual parachains. Rust implementation of the Optimistic Virtual Machine (OVM) runtime modules is called Plasm.
By using Substrate which enables anyone to create a custom blockchain easily, any developer can create a high-speed chain with plasma, state-channel and optimistic roll-ups technology within minutes. Since Plasm is a module for Substrate, we can make Plasm centric blockchains. Based on the above, there are 2 ways to use Plasm.
1.Import Plasm to your Substrate chain for scaling.
2. Build an application or child chains on a Plasm centric Parachain.
There are at least 4 potential reasons we need Plasm centric Parachains: more scalability, Polkadot’s Parachain slots, Polkadot2.0, and bridging.
More scalability
First of all, Polkadot becomes a highly scalable network by spreading transactions across multiple parallel blockchains. We will see many types of Parachain such as an IoT chain, a gaming chain, an energy chain, and a payment chain. In addition to that, there will also be common-good chains like bridge chains, a smart contract chain, a Plasma chain, and a dex chain. Some of these use cases need tremendous transaction throughputs on a Parachain. Plasm makes it possible to build use cases that require high performance without sacrificing decentralization.
Polkadot’s Parachain Slots
Polkadot is a heterogeneous multichain framework. It empowers blockchain networks to work together under the protection of shared security. Many blockchains will be connected via Polkadot, but the number of connected chains is limited and you need to win the slot auction to join the network. Plasm Parachains can be a good option for you if you don’t have enough DOTs to win the slot auction because you can connect your chain to a Plasm Parachain. It means your chain is indirectly connected to Polkadot. From this point of view, I think we can say Plasm Parachains chains are common good chains.
Bridge (Atomic swaps and smart contracts)
Polkadot is compatible with other blockchains like Bitcoin and Ethereum. It should be possible to make a bridge between them with Plasm though we have to think about many technical details like digital signature, hash functions, Hash Time-Locked Contract, and so on. We can make a bridge between a Plasm Parachain and another blockchain (e.g., Ethereum), thus bringing tremendous value to the ecosystem because Plasm provides a secure and trustless solution to move assets from A to B through plasma child chain.
Polkadot2.0
Plasm is a scaling solution that has a hierarchical structure. It is a framework that allows the creation of child chains that use the main chain as a trust layer. We assume that we can use some parts of Plasm technology for Polkadot2.0 where a relay chain connects to another relay chain, providing infinite scalability. It is expected in 2020.
Conclusion
Plasm centric Parachains will not only be natively capable to support Plasma applications but also for State Channel applications or any other layer2 protocols such as Optimistic Rollup and ZK Rollup. Stay tuned for the guide on how to implement a Plasm centric Parachain on the Kusama Network! (coming soon)