Everything you want to know more about Layer 2 Protocols and their impact in scaling transactions

LandOrc
5 min readJun 7, 2022

Ethereum has been the main driving force behind the development of altcoins and the expansion of the crypto market via initiatives like ICO in 2017 and DeFi in 2020. In fact, most DeFi platforms were built on the Ethereum blockchain.

However, Ethereum-based DeFi protocols are increasingly facing scalability issues such as crazy high gas fees and slow throughput. Blockchains such as Ethereum inherently face the famous trilemma which means it cannot achieve decentralization, scalability, and security simultaneously. Both Bitcoin and Ethereum are highly secure and decentralized as they are using the Proof of Work algorithm but have low TPS (transaction per second).

In recent years, many solutions have been proposed to solve the scalability trilemma. Basically, the solutions can be categorized as layer 1 and layer 2. Layer 2 protocols are built on top of the Ethereum Mainnet while layer 1 protocols are completely new kinds of blockchain. Besides that, there are other protocols that cannot be classified as layer 1 or layer 2 solutions, but rather as independent blockchains that run parallel to another layer 1 blockchain. One good example is Binance Smart Chain, which is not a layer 1 or layer 2 protocol, but a fork of the Ethereum blockchain.

What is the difference between layer 1 and layer 2 protocols? According to Wallace (Wallace, 2020), Layer 1 protocols refer to blockchain architecture that is not built on top of another existing blockchain protocol. For example, the Polkadot blockchain is a layer 1 blockchain protocol that uses its own architecture and unique consensus algorithm, and claims to have solved the Ethereum trilemma. On the other hand, layer 2 is a protocol that is built on top of an existing underlying blockchain. For example, the lightning network is a layer 2 solution for Bitcoin while Polygon is a layer 2 solution for Ethereum.

Layer 2 is a term for solutions designed to solve scalability issues by handling transactions off the Ethereum mainnet, while taking advantage of the robust decentralized security model of the mainnet (Wackerow, 2021).

These solutions include:

· Layer 2 Rollups

· State Channels

· Sidechains

· Plasma

Rollups are solutions that perform transaction executions outside the main Ethereum chain (layer 1) before submitting transaction data to layer 1 (Wackerow, 2021). As transaction data are on layer 1, this allows rollups to be secured by layer 1. Rollups inherit the security properties of layer 1, while performing executions outside of layer 1, hence solving the Ethereum trilemma.

Rollups have three inherent properties:

· Transactions are executed outside layer 1.

· Data or proof of transactions are on layer 1.

· An embedded rollup smart contract in layer 1 that enforces correct transaction executions on layer 2 by using the transaction data on layer 1.

In addition, rollups require operators to stake a bond in the rollup smart contract as an incentive to verify and execute transactions correctly.

Rollups have the following advantages:

· Reduced gas fees.

· Open participation.

· Fast transaction throughput.

There are two types of rollups (differentiated by their security models):

· Zero knowledge rollups: runs computation off-chain and submits a validity proof to the chain.

· Optimistic rollups: assumes transactions are valid by default and only runs computation, via a fraud proof, in the event of a challenge.

Zero knowledge rollups (aka ZK-rollups), bundle or “roll up” hundreds of transfers off-chain and generate cryptographic proof, known as a zk-SNARK (Zero-Knowledge Succinct Non-Interactive Argument of Knowledge). It is a proof construction where one can prove possession of certain information, e.g., a secret key, without revealing that information, and without any interaction between the prover and the verifier. This is known as a validity proof and is posted on layer 1.

The ZK-rollup smart contract maintains the state of all transfers on layer 2, and this state can only be updated with a validity proof. Therefore, ZK-rollups only need the validity proof, instead of all transaction data. ZK-rollups can validate a block faster and cheaper as less data is included. Furthermore, there are no delays when moving funds from layer 2 to layer 1 because a validity proof accepted by the ZK-rollup contract has already verified the funds. Being on layer 2, ZK-rollups can be optimised to reduce transaction size further, hence reducing gas fees.

On the other hand, Optimistic rollups run in parallel to the main Ethereum chain on layer 2. They can improve scalability because they do not perform any computation by default. Instead, after a transaction they propose the new state to the mainnet, or “notarise” the transaction. With Optimistic rollups, transactions are written to the main Ethereum chain as calldata, optimising them further by reducing the gas cost. Optimistic rollups can offer up to 10–100x improvements in scalability depending on the transaction. This number will increase even more with the introduction of shard chains because there will be more data available if a transaction is disputed.

Polygon is one of the most successful blockchain that has implemented the rollups solutions. It combines the Plasma Framework, the proof-of-stake blockchain architecture as well as the ZK rollup protocol. The Plasma Framework and ZK rollup protocol used by Polygon allows for the easy execution of scalable and smart contracts. The project seeks to stimulate mass adoption of cryptocurrencies by resolving the problems of scalability on many blockchains.

In addition, Polygon claims that it is a protocol and a framework for building and connecting Ethereum-compatible blockchain networks (Polygon, n.d.), and supports a multi-chain Ethereum ecosystem. Besides that, Polygon features a native token known as MATIC. Polygon adoption in the DeFi space has grown significantly in the first half of 2021 mainly because of cheaper gas fees and faster transactions. Renowned DeFi platforms that have integrated Polygon are SushiSwap, AAVE, Quickswap, Pooltogether, 1inch Exchange, Autofarm and LandOrc.

The latest platform that has integrated Polygon is LandORC, an innovative platform that takes DeFi lending and borrowing in real estate to another level. It is a blockchain-powered ecosystem that facilitates seamless movement of capital and collateral between investors, property developers and land title owners. Its mission is to bridge the real estate funding gap via collateralized lending, enabling the growth of the real estate industry via lower cost of capital while ensuring security, transparency and speed in transactions via the Polygon integration. For further reading, please refer to the landOrc whitepaper and its website. To participate in LandOrc solutions using Polygon go to https://buy.landorc.io/ .

https://medium.datadriveninvestor.com/things-are-shaping-up-for-ethereums-layer-2-projects-6d00f31df128

References

--

--