Introduction
A second layer solution (Layer 2) in blockchain is a way to utilize the underlying blockchain infrastructure to add more features, scalability, and privacy to the transactions made. It is a complementary layer to the existing blockchain network that adds additional features and functionalities to the existing blockchain layer, allowing for more efficient and secure transactions. Layer 2 solutions are becoming increasingly popular in blockchain technology as they offer scalability and privacy options that are not available in the current blockchain infrastructure.
08/17/2022

BaseAltcoinsTechnical Basics

BaseAltcoinsTechnical Basics
Main
- The second layer solution (Layer 2) is a protocol deployed on top of the main blockchain (Layer 1) and designed to increase its scalability.
- L2 solutions are used for popular low bandwidth blockchain platforms such as Ethereum and Bitcoin.
- The second layer solution is deeply integrated with the main network, has compatible smart contracts and crypto assets.
- In the case of Ethereum, a cross-chain bridge will be needed to transfer cryptocurrency between the main network and Layer 2.
What are second-tier solutions for?
Blockchains have a problem known as the “scalability trilemma”. It lies in the difficulty of creating a fast, decentralized and secure network at the same time. Therefore, developers often have to choose and optimize a maximum of two out of three components.
The architecture of early blockchains, primarily Bitcoin and Ethereum, was not designed for a large number of transactions and users, and therefore they have low throughput. For example, in Bitcoin it is 5-7 transactions per second (TPS), in Ethereum it is about 15 TPS.
Scalability can be improved by changing the code of the blockchain protocol using features such as sharding. But this is time consuming and can take years. In addition, such improvements change the fundamentals of the architecture, so the project community is not always willing to make them.
L2 solutions allow at least partially solving the problem of low throughput and high transfer fees without affecting the code of the main blockchain. Their main advantage is the ability to transfer assets between “first level” addresses, while using the “second level”, which can be either a separate off-chain protocol or a separate blockchain.
What second layer solutions are there for bitcoin?
The main L2 project for the first cryptocurrency is the Lightning Network (LN). It runs on a protocol using smart contracts and so-called state channels. The Lightning Network was launched back in 2015, and since then it has continued to develop rapidly. By the end of May 2022, the total capacity of LN channels reached 3900 BTC.
The main function of LN is the ability for Bitcoin holders to make direct exchanges without writing information to its ledger. To do this, you need to open a special channel using one on-chain transaction and place bitcoins in it.
Once activated, the payment channel allows you to make transfers off-chain, that is, outside the main network, with much faster speed and lower commissions. Unlike on-chain transactions, transactions in Lightning Network channels are visible only to their users. Only the initial and final states of transactions are recorded in the main blockchain.
This approach significantly reduces the load on the main bitcoin network: the Lightning Network is capable of processing thousands of operations per second, while ensuring a high level of system security.
How are payment channels protected in the Lightning Network?
The channel is verified by its participants and their mutual smart contracts. Upon completion of the off-chain exchange, the final state is recorded in a new block of the main network. Smart contracts protect transactions within state channels, and also act as “judges” in the relationship of participants.
Some channels use a timer that automatically updates or blocks the on-chain state of transactions. After the set time period, the system automatically starts the final transaction, then updates the main blockchain and closes the state channel based on the last verified transaction. Any new attempt to unlock the state channel creates a new encryption and restarts the timer.
What Layer 2 solutions exist for Ethereum?
Despite the low speed, Ethereum is the most heavily loaded blockchain platform for decentralized applications. It powers many popular projects in the fields of decentralized finance (DeFi) and non-fungible tokens (NFT). Therefore, for Ethereum, the problem of scalability is especially acute.
Now several main L2 solutions are being developed in parallel:
The main technology for their work is Rollups, which has two main varieties:
- Optimistic Rollups. With this solution, transactions are made in the L2 network, and then in large groups they are combined into a compact block, which is included by validators in the main Ethereum network. Optimistic Rollups are used in Arbitrum and Optimism.
- ZK-Rollups. Transactions in the second-level network are also bundled and sent to the Ethereum network, however, they are confirmed using special verifiers, which are cryptographic proof of the validity of operations. Polygon is implemented on the basis of ZK-Rollups. This technology for scaling Ethereum is considered by the main co-founder of the platform Vitalik Buterin.
Whatever the L2 solution, Ethereum as the “first layer” takes on the function of transaction verification and block production, the ledger where the final states are written, and the consensus mechanism. Thus, the project does not need to create its own infrastructure.
There are other Layer 2 projects as well. For example, in July 2022, startup Matter Labs Oannounced about launching zkSync 2.0. A month later, a proprietary protocol written in the Cairo language launched the StarkWare project.
How to transfer assets from the first level network to the second?
To transfer cryptocurrencies from the first level blockchain to the L2 network, you need to use cross-chain bridges.
To work with them, you need a browser-based Web3 wallet, such as MetaMask or WalletConnect. In the wallet settings, you must first add the desired network – for example, Optimism.
The project has its official bridge. On the bridge website, select the asset you want to transfer, specify the amount, confirm the transaction, and in return you will receive the same tokens, but already L2 networks. They also have their own bridges. Polygon And Arbitrum.
Cryptocurrencies of L2 networks can be used almost without restrictions as “original”, for example, for transfers or trading on decentralized exchanges or DeFi protocols. Most large applications support second-tier solution assets. In Uniswap, this approach called “multichain”.
Are sidechains a Layer 2 solution?
Sidechens, which are used, for example, in Cosmos or Polkadot, are not second-level solutions. If the former use their own security system, then the latter rely on the “parent” blockchain in this matter.
Found a mistake in the text? Select it and press CTRL+ENTER
CryptoNewsHerald Newsletters: Keep your finger on the pulse of the bitcoin industry!
Conclusion
Layer 2 solutions offer a more efficient and cost-effective way to scale blockchain networks. By providing an additional layer of abstraction on top of the blockchain, Layer 2 solutions can reduce the amount of data stored on-chain, improve transaction speed, and reduce transaction costs. This makes blockchain technology more viable for larger-scale applications, such as those in the financial and enterprise sectors. Layer 2 solutions are an essential part of the journey towards mainstream adoption of blockchain technology.
Comments (No)