What is Layer-2 on the blockchain?
Blockchain scalability is the biggest issue. Layer-2 solutions are designed to deal with it.
Layer-2 refers to a protocol that operates on top of the main network, allowing faster and cheaper transaction processing. Layer-2 solution is a collective term for all projects that aim to expand the capabilities of Layer-1 blockchains (primarily Ethereum and Bitcoin).
Lightning Network is considered a popular Layer-2 solution for BTC. Plasma, Polygon, Optimism and Arbitrum are a small part of Ethereum-based Layer-2 technologies.
How does Layer-2 solution work?
Layer-2 protocol consists of two components: a transaction processing network and a smart-contract based on Layer-1 blockchain, which allows consensus between two networks to be reached by adding processed second-level transactions to the underlying blockchain. Thus, Layer-2 solutions support increasing load on the main chain of blocks.
The common characteristic of all L-2 solutions is that they must provide the main network with a cryptographic "proof" of the accuracy of the proposed transactions, which must be recorded in a distributed registry.
In addition, Layer-2 technologies differ in that they inherit the security of the main network on which they are built. Therefore, the transmitted information is verified and confirmed by the underlying blockchain, not by individual nodes.
Cross-chain bridges connect Layer-2 and Layer-1, so it allows users to transfer digital assets.
What are the main types of Layer-2 created for Ethereum?
Ethereum blockchain switched to a Proof-of-Stake consensus model in September. One of the goals of the transition was to improve scalability. However, Layer-2 solutions still remain relevant for this network.
The main types of Layer-2 are called "Rollups". They perform transaction operations off the main blockchain and as a result, they need the main chain of blocks to check their activity and store transaction data. Then rollups combine a large number of transactions into one compact block and transmit them to the blockchain. One validator is sufficient to confirm transactions in the L-1 rollup blockchain.
There are 2 types of rollups, depending on how the information they transmit is proved and recorded in Layer-1.
Optimistic Rollups operate on the “Proof of Error” principle. According to this approach, Layer 2 solutions automatically assume that all transactions are valid. If a network user believes that the information is recorded incorrectly, he can dispute it by providing the smart contract with the relevant evidence. When the "proof of error" is exposed,the transaction is re-executed and compared with the original one. If the new transaction differs, the original record is invalidated and cancelled. Optimism and Arbitrum are among the projects of L2 type.
Zk-Rollups operate on the "Proof of Validity" principle. Blocks are confirmed by special verifiers that cryptographically prove the validity of the operation. This process is opposite to the previous one, as in this case all calculations and transactions must be verified and proved in advance. Polygon technology belongs to this type. According to Ethereum blockchain founder Vitalik Buterin, this L2 blockchain is considered to be the first for scaling ETH. This is because zk-Rollups perform block validation much faster than other types of Layer-2.
Benefits of Layer-2 solutions
There are two main benefits of L2 solutions: increased number of transactions per second (TPS) and reduced gas fees. It also helps to improve security by making updates in Layer-2 without data changes in the main blockchain.
Layer-2 became a popular method of solving the scalability problem and it influenced the development of the cryptocurrency sphere. The creation of a large number of new DeFi projects and decentralized applications would not be possible without these protocols, as L2 solutions help to meet users' demand for cryptocurrency, which arose as a result of the evolution of blockchain technology.