What are layer 2 and how do they work?

Layer 2 or layer 2 (L2) are scalability solutions that are implemented in layer 1 (L1) blockchains to improve scalability while maintaining the security guarantees of the main blockchain. This allows the main network to be decongested and at the same time improve the efficiency of use. They are fundamental for the scaling of blockchains, which face the problem of the blockchain trilemma. Let's see what layer 2 are, how they work and which are the most popular.

What are layer 2?

Layer 2 or layer 2 (L2) They are scalability solutions that are implemented on blockchains of layer 1 (L1) to allow improving scalability while maintaining the security guarantees of the main blockchain. These solutions They began to be implemented at the moment when it was seen that it was quite difficult to decongest certain blockchains like Ethereum and Bitcoin at the moment that began to increase the volume of transactions due to the adoption which emerged between the end of 2020 and the beginning of 2021. This is due to the blockchain trilemma, which states that a simple blockchain architecture can only achieve two of the three principles. These principles are the decentralization, security and scalability, of which, scalability is the most difficult to achieve. Putting the two most important blockchains in the ecosystem into context, Bitcoin could only process 7 transactions per second (TPS) and Ethereum 15, which can lead to certain situations to periods of congestion when the network has a lot of volume.

table 1

Differences between a layer 1 and a layer 2. Source: 101 Blockchains.

How do layer 2 work?

As we have explained in the last paragraph, layer 2 are solutions that allow the main blockchain to which they are integrated to scale, thus reducing the congestion of the main chain and in turn the payment of commissions per transaction. A layer 2 blockchain communicates regularly with the main network sending transaction packets to ensure that it has similar security and decentralization guarantees. These solutions do not require changes to the layer 1 protocol. (like Bitcoin or Ethereum), allowing layer 1 to manage security, decentralization and data and layer 2 to handle scalability. That is, mainly these solutions allow reduce the workload of layer 1 transactions, where completed posttests return to the main layer. In this way, layer 1 is decongested, thus allowing scalability to be improved. One of the best-known layer 2 solutions are rollups, which We explained in previous articles. —2023/03/image-63.pngFunction of a Polygon layer 2. Source: The New Stack.

What are the benefits of layer 2?

Mainly, we can define three benefits of using layer 2:

  1. Maintain network security: Layer 2 blockchains seat their transactions on the Ethereum mainnet, allowing users to benefit from the security of the Ethereum network.
  2. Decongest the network: By combining multiple off-chain transactions into a single transaction at layer 1, mainnet traffic is uncongested, dramatically reducing transaction fees and making the mainnet more accessible to everyone.
  3. Expansion of use cases: By allowing more transactions per second, reduce commissions and introduce new technologies, new applications will appear in the projects with a better user experience.
table 2

Different applications present in the layer 2 ecosystem. Source: L2BEAT.

How can you migrate to layer 2?

There are two main ways to move our assets to a layer 2: transfer funds from Ethereum through a smart contract or withdraw your funds to an exchange directly to the layer 2 network:

  • The first option requires us to have the funds on the Ethereum main network and we will need to use a bridge to transfer it from the Ethereum main network to layer 2.
  • The second option is simpler, since some centralized exchanges now offer direct withdrawals and layer 2 deposits. However, you should verify which exchanges support layer 2 withdrawals and which layer 2 they support.
capture 3

Optimism bridge to migrate mainnet tokens to Optimism. Source: Optimism.

What are the best known layer 2?

Within the layer 2 panorama we can find projects that have allowed any action feasible in layer 1 to be carried out within their layer 2. There are many projects that have begun to migrate their dapps to these solutions, some have even skipped the integration of layer 1 and have been deployed directly to layer2. We can see the panorama of the layer 2 via the L2BEAT page. Let's see which are the most popular layer 2:

Lightning Networkk

As We explained in previous articles, Bitcoin's Lightning Network is one of the first scalability solutions built into the Bitcoin blockchain. This solution made it possible to improve the scalability of the Bitcoin blockchain and in turn improve its transaction speed. In turn, the integration of this layer 2 has allowed non-fungible tokens (NFT) to be integrated directly into the Bitcoin blockchain for the first time in history. the so-called Ordinals.

Optimism

Optimism accelerates transactions on Ethereum at a fraction of the cost of a typical on-chain transaction. This is achieved through a technology called optimistic rollups that bundles multiple transactions by “rolling” them into a single transaction and placing them on another blockchain. Optimism is the so-called layer 2 scaling solution. The name of the protocol comes from the fact that all validators optimistically assume that all transactions that have been pooled are valid. Validators have one week to review the entire package for fraudulent transactions.

Arbitrum One

Arbitrum is a Layer 2 solution designed to enhance the capabilities of Ethereum smart contracts, increasing their speed and scalability, while adding additional privacy features to boot. The platform is designed to allow developers to easily execute unmodified Ethereum Virtual Machine (EVM) contracts and Ethereum transactions on a second layer, while benefiting from the excellent security of Ethereum on layer 1.

Polygon

Polygon is a Layer 2 scaling solution built for help bring mass adoption to the Ethereum platform. It meets the diverse needs of developers by providing tools to create scalable decentralized applications (dApps) that prioritize performance, user experience (UX), and security. Polygon achieves this largely due to the underlying technical architecture of its proof-of-stake (PoS) commitment chain and its most viable plasma L2 scaling solution (MoreVP).

boba network

Boba Network (formerly OMG Network) is a layer 2 optimistic cumulative scaling solution currently based on Ethereum. Boba Network facilitates cheaper and faster transactions, as well as a unique new technology, Hybrid Compute. Hybrid Compute enables interoperability of Web3 and Web2, allowing smart contracts to call upon any external Web2 API to execute complex algorithms. Boba Network is the home of DeFi, NFT, Gaming and Metaverse applications.

zkSync

zkSync is a Layer 2 protocol based on zk-Rollup technology that offers scalable and affordable payments on Ethereum. It is a resource that guarantees an optimal level of security while optimizing scalability, transparency and other elements of the network. The protocol manages to significantly reduce the cost of operations by combining zkRollup and zkPorter accounts. Thanks to this combination, a volume of 20,000 transactions per second (TPS) is reached.

Loopring

Loopring seeks to offer rewards to all ecosystem participants to perpetuate the decentralized and non-custodial exchange. The purpose of the protocol is to become a hybrid ecosystem. Among other things, its goal is to facilitate centralized order matching exchanges with decentralized on-chain order settlement exchanges.