Deep Dive in Layer 2 Solutions

Raydius Research
6 min readMay 28, 2021

As there is more demand in base layer blockchain like Ethereum, we are reaching a bottleneck for the infrastructure; in the meantime, the scalability issue of Ethereum is starting to be a real pain point for both decentralized applications and users. A lot of research and efforts have been dedicated to solve the problem both from the angle of upgrading the layer 1 blockchain and also layer 2 scaling technologies. Although these two technologic angles are not conflicting with each other, since Ethereum 2.0 is still not live and restricted by the current architecture of Ethereum, the layer 2 scaling solutions are gaining more attention from the crypto community and have made great progress since the idea was introduced.

Compared with layer 1 upgrade of the core contracts, layer 2 solutions take a detour to solve the problem of scalability and speed limitations. The core idea is to shift the transactions from the mainnet to layer 2 blockchain and only use layer 1 to ensure that transactions are completed smoothly. Even though the design thesis of layer 2 solutions sacrificed security and general usability, it is still attractive to a lot of applications that are less dependent on security and finality since it offers a good balance to transaction cost, speed and user experience.

After several years of research and development, many different technical designs for layer 2 solutions have emerged in the Ethereum ecosystem. As there are more implementations available for the layer 2 scalability, the competition is getting heated and the different advantages and disadvantages are becoming obvious for investors and users.

State Channel

As the first generation of layer 2 solutions, the state channel is very suitable for a fixed group of users that need to perform multiple transactions and update application status during a period of time. It introduces a “challenge period” to ensure the security of transactions. Since the transactions are all happening in a “channel”, it ensures privacy for users. However, due to the hypothesis that all participants are online imposed by the “challenge period”, users or their agents need to continuously monitor the layer 1 blockchain in order to avoid malicious behavior when the other party submits transaction status to the layer 1 blockchain while uptime requirement is not very user friendly. In the meantime, since the change of members in the state channel needs to change the contract, it is not suitable for one-time transfers and short-period transactions.

Plasma

Similar to the state channel, Plasma is also a technology that manages off-chain transactions and leverages Ethereum blockchain for its security. Different from the state channel, Plasma proposed a scalable framework that allows users to create “child” blockchain that are attached to the main Ethereum blockchain. Users could perform more complex transactions on the child chain and support large scale applications with minimum interaction with the Ethereum main chain. Plasma also relies on the hypothesis that participants are online and that data is all available — meaning that users need to believe that operators will provide all transaction data, in order to use these data to verify the correctness of the transaction. It requires layer 2 chain to interact with layer 1 blockchain constantly and verify the data, which prolongs the exit time. Moreover, neither state channel nor Plasma support smart contracts, which limits the interoperability with EVM.

Rollups

Due to the limitation of state channel and Plasma in various use cases, most of the projects adopting the technology are stuck in stagnance, only a few teams are still progressing. Therefore, a layer 2 solution that could balance scalability, speed, security and usability is much needed in the Ethereum ecosystem. Rollup technology is a general term for the new generation of scaling technology after state channel and Plasma with the core design thesis to package multiple transactions into one in order to reduce the interaction with layer 1 blockchain and reduce gas fee. In the meantime, since Rollup solutions use the call data from Ethereum to acquire transaction data from layer 1 to the layer 2 blockchain, it avoids the data availability limitation in Plasma.

In terms of the implementation of rollup technology, there are ZK Rollup (ZKR) and Optimistic Rollup (OR), which use zero-knowledge proof in cryptography and fraud-proof in game theory to ensure the network and data security. Since security is the utmost important feature for scalability solutions, rollups are considered the most promising layer 2 scaling technology.

The design thesis for ZKR is simple: to separate computation from verification — all the assets are held by smart contracts on the layer 1 blockchain while the computation and storage is done off-chain. Each rollup block will produce a zero-knowledge proof for the changes of state and verify it using the smart contract on the layer 1 blockchain.

OR learns from the design of Plasma and ZKR, it predicts the layer 1 status “optimistically” based on the data from layer 2; it will continue with transactions until users report on a fraudulent block, where the fraudulent transaction will be reversed and that malicious block producer will be penalized by the network.

Although rollup technology has already been considered the default technology for scaling Ethereum, or even the only viable choice in the short term, there are limitations both for ZKR and OR. ZKR is fast and secure, but there are still compatibility issues with existing smart contracts. While OR could support high compatibility with existing smart contracts, there is still the issue with “challenge period” — if the “challenge period” is set to be too short, the security level is affected; while the trading efficiency will be affected if set too long. Overall speaking, rollup is still the best solution so far based on technology readiness and security — and there will likely be a dominating project based on rollup in the layer 2 landscape.

Side Chains

On top of the three technologies, side chains are also a viable solution for layer 2 scalability. Side chain uses a different consensus mechanism; therefore, the security for side chains are separate from the main layer 1 blockchain. This is the biggest drawback of the side chain technology — it is hard to ensure the security level of the side chain. If effective technologic design could be implemented to side chains, it could be considered an optimal solution for layer 2 scaling due to its high compatibility with EVM and high trading efficiency.

Based on the analysis above, it can be shown that the major measurement for evaluating different layer 2 solutions include security, compatibility, cost, speed, scalability, user experience and so on; while a lot of progress have been made, the current solutions are not perfect. Under this background, the competition among layer 2 solutions from different technical designs is getting heated. Instead of scaling and connecting the Ethereum ecosystem, the current layer solutions are segregating liquidity on Ethereum. Therefore, to solve the problem of segregated liquidity, there are two options: firstly, we can use layer 1 to support cross-layer 2 applications, and use layer 1 as a bridge to connect two different layer 2 solutions; secondly, to build cross-layer 2 liquidity solutions including state channels, bridges etc. For the first solution, it is hard to avoid problems like high transaction fees and long settlement time, which make it unfriendly for users. Hence, a cross-layer 2 liquidity solution becomes the inevitable component in the Ethereum ecosystem.

To build a competitive liquidity solution, not only connecting layer 2 blockchains but also security, usability, low cost and good user experience must be taken into consideration in order to support an ecosystem that is secure and efficient for users. Driven by these thesis, the team introduced Raydius — a layer 2 solution for a more connected multichain future.

In terms of security, Raydius used Substrate as the development framework and maintains PoS consensus in the decentralized network, which avoids risks by a malicious centralized network operator. Since all the block information is synced to Ethereum, the system could achieve a higher level of security by syncing more frequently with Ethereum. In terms of the bridge design, validators would be required to put up a stake based on the value of transactions they are processing. By dynamically adjusting the deposit requirement, Raydius adds another level of security for the asset.

Besides, in terms of usability and compatibility, Raydius provides SDK that are open for other applications to integrate. Using Substrate, it could support EVM, eWasm and other virtual machine modules that would make it easier for developers to deploy smart contracts. Meanwhile, the flexibility and modularization design also allows Raydius to support more programming languages in the future, which makes it more competitive for developers from different backgrounds.

From the analysis above, it can be shown that security, usability and compatibility are prime considerations for Raydius produce development. Raydius seeks to thrive with the maturity of layer 2 technology and benefits from partnership with more layer 1 and layer 2 ecosystems to create a better future for blockchain.

--

--

Raydius Research

A social gaming platform to onboard millions of users. Powered by Raydius Research #BinanceLabs Incubation Season 3