Is Layer 2 the Way Ahead for Blockchain Scaling?

Written by falconite | Published 2021/02/19
Tech Story Tags: blockchain | l2-scaling | matic-network | v-systems | xlumi | loopring | parastate | lightning-network | web-monetization

TLDR Layer 2 (or L2) solutions have come up as a practical solution to this scalability mess. They inherit the security properties of the underlying blockchain and provide greater throughput (or transaction processing capacity) and lower transaction fees. Lightning Network uses payment channels, which allow the majority of transactions to be settled off-chain, leaving only the final state of the nodes to be recorded on the blockchain. Matic Network has been a trusted name when it comes to L2 scaling solutions on the main chain.via the TL;DR App

Scalability has arguably been the sharpest thorn in the flesh of both DApp developers and users. Most popular public blockchain networks are unable to scale up transactions when network traffic increases. Any time an
application built on Ethereum gets popular, transaction fees on the network go up to tens of dollars!  
Layer 2 (or L2) solutions have come up as a practical solution to this scalability mess. As opposed to Layer 1 (L1) solutions, which try to improve the performance of the blockchain protocol itself, L2 solutions run on top of the L1 blockchain. They inherit the security properties of the underlying blockchain and provide greater throughput (or transaction processing capacity), lower transaction fees and faster transaction confirmations.
Over the years, blockchain projects have employed L2 scaling techniques such as State channels, Sidechains, Plasma and ZK Rollups to various degrees of success. In this article, we’ll look at popular L2 scaling techniques along with some of the recent developments in the field of L2
scaling.

Payment (State) Channels

When it comes to Bitcoin scaling, the first name that comes to mind is Lightning Network. The project employs payment channels, which allow the majority of transactions to be settled off-chain, leaving only the final state of the nodes to be recorded on the blockchain.
Payment channels are a subset of what are known as state channels, which can support not only payments but also general ‘state updates’ and data broadcast.
Since only the participants that are involved in the transaction are required to know all its details, it is unnecessary to record every single transaction in the blockchain. The involved parties can keep on transacting through the state channel, and only when the channel is closed are the final state of the nodes broadcasted to the network and recorded as a single on-chain transaction.
Lightning Network uses a ‘punishment’ payment channel, which allows either participant to sign transactions offline that output different amounts to the two parties. If a participant attempts to broadcast old states, he/she is punished by the protocol by allowing the other participant to obtain all the funds in the channel.
Lightning Network reduces the need to open a channel with every party on the network that is involved in the transaction, further reducing the number of on-chain transactions and reducing the cost and time
required for transactions.
By using payment channels, the Lightning Network allows for exceptionally low fees and promises massive scaling across the network. This can result in lower on-chain stresses and lead to emerging use cases (such as instant micropayments).

Sidechains

Matic Network has been a trusted name when it comes to L2 scaling solutions on Ethereum for considerable time now. To increase throughput, Matic creates a two-way peg between the main blockchain and Matic’s proprietary sidechain, dividing the workload between the two.
Users can transfer mainchain coins to coins on this sidechain to complete transactions. Once all transactions are confirmed on the sidechain, the coins are transferred back to the mainchain, thus enabling users to utilise the advantages of the sidechain without changing the main chain's protocol. Since the sidechain can allow more powerful customized smart
contracts and higher transaction speeds, transactions can be settled much
faster on the sidechains.
Matic’s scaling technology comprises of an adapted version of Plasma with PoS based sidechains. Plasma refers to a framework that allows the creation of ‘child’ blockchains which use the main Ethereum chain as a trust and arbitration layer. The child (or side) chains can be configured to
match the demands of specific applications, further improving efficiency and throughput.
There are security concerns for sidechains, however, as they typically have much less computing power to maintain consensus as compared to the main chain. This opens up the possibility of miners in the main chain to
attack the sidechain.
In a recent update, Matic announced that the project is re-branding to Polygon, where they would experiment with other scaling techniques like ZK Rollups and Optimistic Rollups. Polygon also plans to work on implementing inter-chain communication protocols and create an
Internet of blockchains based on Ethereum.

xLumi

V Systems, a blockchain infrastructure project aimed at providing high network throughput and security for Web3.0 applications, recently launched their own version of payment channels. Known as xLumi, this modified version of payment channel can power fast and secure micropayments on the blockchain.
Unlike traditional bidirectional payment channels, xLumi allows funds to be transferred in only one direction. Payment transactions can happen offline by letting the payer sign a transaction and passing it to the recipient; the recipient, on his/her part, has to broadcast the payer’s signature to the blockchain to make sure that the payer had actually intended the transaction.
Since the amount paid to the recipient can only increase, the unidirectional payment channel ensures that only newer states are broadcast. This makes sure that the payer cannot cheat by signing an offline transaction and then withdrawing all the funds from the channel.
Participants can agree upon the expiration time within which the recipient has to broadcast an update before the opening of the payment channel. xLumi transactions can happen offline, which enablesrepeated payments to be done without paying any transactions\ fees. This allows users to make
high-frequency low-volume micro-payments free of cost.
As compared to Lightning Network’s punishment payment channels, xLumi ensures that the correct state of the payment channel is maintained without punishing malicious parties. This drastically reduces the complexity of payment channels, along with the number of interactions and storage of keys required for every transaction.

ZK Rollup

ZK Rollup is a relatively new L2 scaling technology. Loopring, a protocol for developers to build high-throughput, non-custodial, orderbook-based exchanges on Ethereum, leverages on ZK Rollups. As proof of concept, Loopring has created a DEX that achieves 2,000+ TPS using ZK Rollups.
In cryptography, a Zero- Knowledge Proof (ZK Proof) is a method by which one entity (the ‘prover’) can prove to another identity (the ‘verifier’) that they have the knowledge of particular information without revealing the information itself. ZK proofs are the fundamentals on which various privacy techniques have been developed.
Meanwhile, a Rollup is an L2 scaling solution similar to Plasma, allowing hundreds of side chain transactions to be processed offline with only a single hash of the side chain block being included in the main blockchain. However, while Plasma creates one transaction per transfer, ZK Rollups bundle hundreds of transfers into a single transaction.
In ZK Rollup, all funds are held by a smart contract on the main chain while it performs computation and storage off-chain. Validity of the side chains is ensured by ZK proofs, which enables the protocol to compress the aggregated transactions and reduces the amount of information that is written in the main chain.
Recently, Loopring unveiled gasless transfers from L2 to L1 environment. With this feature enabled, users will no longer be constrained by being only able to transact with other L2 protocols; they would now be able to transfer assets from Loopring L2 accounts to any Ethereum L1 wallet.

So, is L2 the way ahead?

While a bunch of new blockchain projects are adapting the L2 way of life, not everyone is convinced that L2 is the way ahead. ParaState, a Polkadot project which provides a smart contract virtual machine for writing Ethereum-compatible smart contracts in popular programming languages and running them on Polkadot, believes that L2 is inferior to L1 scaling.
In many cases, L2 solutions require developers to learn and use new programming languages to builds DApps on the new chain. Moreover, use-case scenarios which involve interaction with multiple L2 protocols built on
the base chain can dampen the user experience while also leading to higher transaction fees overall.
ParaState believes that L1 solutions are inherently more secure, feature-rich, and stable. Unlike popular scaling solutions like Matic, ParaState wants developers to make use of all the tools and features available on Ethereum.
Harmony, a fast, secure and highly scalable blockchain for deploying Web3.0 applications, is another such example. By integrating sharding with PoS consensus mechanism, Harmony provides fast finality (<2s) through its L1 framework itself.
So which side are you on, L1 and L2?
If you have any new interesting L2 project that you would like to share, please do mention it in the comments.
PS: the author doesn’t have any vested interest in Matic, V Systems, Loopring, ParaState or Harmony. The author, of course, has more than enough vested interest in both Bitcoin and Ethereum.

Published by HackerNoon on 2021/02/19