Published in


What is L2 and why is it needed?


So, what exactly is layer 2?

How is it done?

  • When it comes to scaling solutions, Channels are one of the first widely discussed solutions. They allow participants to exchange transactions off-chain x number of times, while only submitting two transactions to the base layer. The most popular types of channels are state channels and their subtypes — payment channels.
    Although channels have the potential to easily process thousands of TPS, some of their downsides are that while using channels, participants have to lock-up their funds in a multisig contract, which practically means no support for open participation. Moreover, this scaling solution is application-specific and cannot be used to scale general-purpose smart contracts.
  • Plasma is a layer 2 scaling solution that was proposed by Joseph Poon and Vitalik Buterin. It’s a framework for building scalable applications on Ethereum that leverages the use of smart contracts and Merkle trees to enable the creation of an unlimited number of child chains which are copies of the parent Ethereum chain.
    Offloading transactions from the main chain to a child chain allows for fast and cheap transactions. But, on the other hand, one drawback is that users have to wait several days before they’re able to withdraw their funds from the child chains. Moreover, just like Channels, Plasma also doesn’t support general-purpose smart contracts execution.
  • Sidechains are Ethereum compatible, independent blockchains with their own block parameters and consensus models. These sidechains are connected to the main Ethereum chain by a two-way bridge. Hence, contracts deployed to the Ethereum base layer can also be directly deployed to the sidechain.
  • Rollups provide scaling by bundlings aka rolling, sidechain transactions into a single transaction, and generating a cryptographic proof, also known as SNARK (Succinct Non-interactive ARgument of Knowledge), that is submitted to the base layer. With rollups, all transaction state and executions are handled on sidechains. The main Ethereum chain only stores transaction data.
    There are two types of rollups: (i) ZK Rollups, and (ii) Optimistic Rollups. ZK Rollups, although faster and more efficient than Optimistic Rollups, do not provide an easy way for the existing smart contracts to migrate to layer 2. Optimistic Rollups, on the other hand, run an EVM compatible virtual machine called Optimistic Virtual Machine (OVM) which allows for executing the same smart contracts that can be executed on Ethereum.




Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store