More

    What Is Layer 2 Blockchain?

    The blockchain is structured into multiple layers. Layer 0 is the infrastructure protocol that sets all the rules that dictate how the decentralized network operates. Layer 1 is the blockchain that we know like Bitcoin and Ethereum. It’s basically the main chain where everything takes place. Layer 2 blockchain is built on top of layer 1. What is the L2 blockchain and why does it even exist? Let’s start peeling. 

    What Is Layer 2 Blockchain?

    Layer 2 blockchain is an off-chain network built on top of the pre-existing layer 1 blockchain. This network inherits the security and consensus mechanisms of the underlying blockchain. Layer 2s have two parts:

    • The network that processes transactions 
    • A smart contract, hosted on the underlying blockchain, holds, receives, and validates transactions from L2.  

    How Does A Layer 2 Blockchain Work?

    Layer 2 is a secondary protocol that takes some of the load of the chain it’s built on. Let’s take an example of a kitchen in a restaurant. Imagine if one chef is doing everything from taking in the orders to preparing the ingredients to then making the food and serving it. It would take him so much time. 

    However, each employee in the kitchen takes on a certain task to decrease the workload per person and increase the speed. Layer 2s have the same concept. They’re like the prep station for L1s in order to decongest it. 

    Instead of the main chain doing everything, it handles the security, data availability, and decentralization, and L2s handle scaling. There are different L2 solutions that differ in application, speed, and process. Before jumping to that, let’s understand L1’s core issue and why layer 2s are actually important. 

    Layer 1 Scaling Problems

    Layer 1s, or what we commonly know as blockchains, are unable to scale while simultaneously maintaining security and decentralization. Ethereum’s co-founder, Vitalik Buterin, summarized the problem with the term “blockchain trilemma”. 

    Blockchain Trilemma

    Let’s go over the trilemma quickly. The blockchain is characterized by being decentralized, meaning that it operates without a central authority. It’s a peer-to-peer network and they agree on how things operate based on a consensus mechanism. 

    Given that it’s decentralized, it’s also more secure than web2 – what we commonly know as the Internet. It’s significantly hard to hack a blockchain since you’d need power over 51% of the network. 

    Now, the problem is the more secure and decentralized the blockchain is, the slower the process of validating transactions and the higher the fees. This makes it harder for networks to be widely adopted. But, if developers want to focus on making these networks more scalable, they’d have to forfeit security or decentralization. 

    Hence why layer 2 blockchains were set in motion. 

    Layer 2 Blockchain Scaling Solutions

    Obviously, L1s are struggling so why would we build something on top of them given their state? Because as I said above, L2s actually take a load off of the blockchain instead of adding to it. For example, L2 often batch together transactions and sends them to L1 for validation which makes the underlying chain less congested. 

    There are multiple layer 2 solutions that deal with scaling mainly state channels, side chains, optimistic rollups, and zero knowledge rollups. 

    State Channels

    State channels, also known as payment channels, allow users to conduct off-chain transfers of on-chain tokens. In this case, the blockchain only has the role of validating these transactions. And, because the transactions are taking place off-chain they don’t have a fee. 

    In order for state channels to work, the users have to pre-fund liquidity into the channel and agree on the amount that each gets. They do so through a smart contract hosted on layer 1 blockchain. We’ve explained state channels in detail here

    Layer 2 blockchain solution state channels

    Side Chains

    Side chains are separate networks that run parallel to the main chain to handle some of the transactions and lower the load on L1s. These also allow different chains to interact with one another solving the interoperability issue. We’ve explained in detail what side chains are here

    Side chains

    Rollups 

    Blockchain rollups batch (or “roll up”) multiple transactions into one before sending it to layer 1. They take multiple transactions, compress the data, and send it back to the mainnet for miners to double-check and validate. 

    Optimistic Rollups

    Optimistic rollups batch together the transactions off-chain by assuming each transaction in the batch is valid. Hence the name. After sending it to the mainnet, miners can challenge the assumption of these transactions are valid. If it’s valid, they add it to the blockchain. 

    Optimistic rollups

    Zero Knowledge Rollups

    Zero-knowledge (ZK) rollups also batch together transactions off-chain before sending them to the main chain for validation. However, ZK rollups generate cryptographic proofs (ZK proof) that validate the authenticity of the transactions in the batch. 

    Layer 2 blockchain zero knowledge rollup

    Conclusion

    Layer 1 scalability problems are a pain to everyone involved. New solutions continue to come up in hopes of one day being able to have a scalable secure fully decentralized network. Well, this network actually exists… in theory. It’s Web4!

    LEAVE A REPLY

    Please enter your comment!
    Please enter your name here

    Stay in the Loop

    Stay in the loop with blockchain Witcher and get the lastest updates!

     

    Latest stories

    You might also like...