- No Comments
What is a second -level solution (Layer 2) in the blockchain?
Blockchains are characterized by a problem known as a “trillema of scalability”. It consists in the difficulty of creating at the same time a quick, decentralized and safe network. Therefore, often developers have to choose and optimize a maximum of two components of three.
The architecture of the early blockchains, primarily Bitcoin and Ethereum, was not designed for a large number of transactions and users, and therefore have low throughput. For example, in bitcoin it is 5-7 transactions per second (TPS), in Ethereum-about 15 TPS.
It is possible to increase scalability by changing the code of blockchain protocol using functions such as charming. But this takes a lot of time and can stretch for years. In addition, such improvements change the basics of architecture, so the project community is not always according to them.
L2-solutions make it possible to at least partially solve the problem of low throughput and high translation commissions without affecting the code of the main blockchain. Their main advantage is the possibility of translating assets between the addresses of the “first level”, using the “second level”, which can act as a separate offchain protocol and a separate blockchain.
What are the second -level solutions for bitcoin?
The main L2 project for the first cryptocurrency is Lightning Network (LN). It works on the protocol using smart contracts and the so-called condition channels. The Lightning Network network has been launched back in 2015, and from that moment it continues to develop actively. By the end of May 2022, the total capacity of LN channels reached 3900 BTC.
The main function of LN is the opportunity for bitcoin holders to make direct exchanges without recording information in its register. To do this, open a special channel using one onchain transaction and place bitcoins in it.
After activation, the payment channel allows you to make offchain transfers, that is, outside the main network, with much greater speed and smaller commissions. Unlike onchain transaction, operations in the channels of Lightning Network 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: Lightning Network is able to process thousands of operations per second, while ensuring a high level of security of the system.
What are the payment channels in Lightning Network?
The channel is verified by its participants and their mutual smart contracts. Upon completion of offchain exchange, the final condition is recorded in the new block of the main network. Smart contracts protect transactions within the framework of the state channels, and also act as “judges” in the relationship of participants.
Some channels use a timer that automatically updates or blocks the onchain-conditioning of transactions. After the deadline, the system automatically launches 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 leads to the creation of a new encryption and re -triggers the timer.
What solutions Layer 2 exist for Ethereum?
Despite the low speed, Ethereum is the most highly loaded blockchain platform for decentralized applications. It operates many popular projects in the fields of decentralized finance (Defi) and non -replaceable tokens (NFT). Therefore, for Ethereum, the problem of scalability is especially acute.
Now several main L2-solutions are developing at once at once:
The main technology for their work is Rollups, which has two main varieties:
- Optimistic Rollups. Using this decision, the transaction is made in L2 networks, and then in large groups they are combined into a compact block, which is included in the validators in the main Ethereum network. Optimistic Rollups are used in Arbitrum and Optimism.
- ZK-Rollups. Transactions in the second -level network are also combined into packages and sent to the Ethereum network, however, they are confirmed using special verifiers that are cryptographic evidence 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 Vitalik Buterin platform.
Whatever the L2-solution, Ethereum as the “first layer” takes on the function of checking transactions and production of blocks, the register, where the final states are recorded, and the consensus mechanism. Thus, the project does not need to create its own infrastructure.
There are other Layer 2 projects. For example, in July 2022, the startup Matter Labs announced the launch of ZKSYNC 2.0. A month later, his own protocol, written in Cairo, launched the Starkware project.
How to translate assets from a network of the first level to the second?
In order for the translation of cryptocurrencies from the first-level blockchain to L2-network, you need to use the cross-bridges.
To work with them you will need a browser 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 own official bridge. On the bridge website, select an asset that you want to translate, indicate the amount, confirm the transaction and in return receive the same tokens, but already L2-networks. Polygon and Arbitrum also have own bridges.
Cryptocurrencies L2-networks can be used almost without restrictions as “original”, for example, for transfers or trading on decentralized exchanges or in Defi protocols. Most large applications support the assets of the second level solution. In Uniswap, this approach was called “Multichain”.
Do Sidchanes belong to Layer 2 solutions?
Sadsen, who use, for example, in Cosmos or Polkadot, are not second -level solutions. If the former use their own security system, then the latter rely on this issue on the “parental” blockchain.