Yield App

Decoding blockchains: An introduction to Layer 2

13 min read
  • Decoding blockchains: An introduction to Layer 2

    • Layer 2 blockchains are built on top of existing blockchains and aim to solve the scalability issues faced by many Layer 1 blockchains.

    • The most successful Layer 2 solutions are optimistic and zero-knowledge rollups, which account for 95% of the Layer 2 market share.

    • By dividing the workload, rollups help Layer 1 blockchains to scale. In most cases, rollups take over the execution of transactions from Layer 1.

    • Lower gas fees, better onboarding experiences and exclusive dApps promote the adoption of Layer 2 blockchains, which now account for nearly 50% of all transactions in the Ethereum ecosystem.

    In the first part of the decoding blockchains series, we explored the landscape of Layer 1 blockchains, which is the foundation of the decentralized digital economy. However, the largest of these blockchains – Ethereum – is facing network congestion and scalability issues as the adoption of decentralized apps (dApps) and cryptocurrencies continues to grow.

    To allow widespread adoption to flourish, Layer 1 blockchains use different approaches to scale the underlying infrastructure and meet the growing demand from users and institutions.

    READ: Earn more passive income on your crypto assets with our new Earn+ product

    One of these solutions are Layer 2 blockchains – second-Layer networks that run on top of existing blockchains. While still in the early stages of development, Layer 2 solutions have already shown great promise in terms of scalability and are likely to play a key role in the future growth of the blockchain industry.

    In our second installment of this series, we address the cryptographic breakthroughs that will be critical to tackle the next wave of blockchain adoption. We contrast the two predominant Layer 2 solutions – optimistic rollups and zero-knowledge rollups, compare their benefits, and examine the key metrics of the most promising Layer 2 solutions.

    Solving blockchain network scalability – What is a Layer 2 blockchain?

    Layer 2 blockchains are the answer to the problems of scalability faced by some blockchain ecosystems, the most prominent being Ethereum.

    Currently, the Ethereum blockchain processes around 15 transactions per second (TPS), while the Visa network, for reference, processes around 60,000. For the blockchain network to scale to be able to serve the masses, it needs to reach 100,000 TPS or more.

    A Layer 2 is a separate blockchain that takes the transactional burden away from Layer 1. It is connected via a smart contract deployed on the Layer 1 blockchain. Their figurative definition comes from the fact that they build on top of the existing infrastructure.

    READ: Is Bitcoin the equivalent of digital gold?

    Layer 2 scaling solutions and their underlying cryptography bring two major benefits to the ecosystem:

    • Increasing the TPS and transaction speed while lowering the gas fees of the network

    • Unlocking new use cases that otherwise would not have been possible

    Monolithic vs modular blockchain design

    Blockchains perform three major tasks that allow transactions and dApps to function:

    • Execution (Passing the state of the blockchain ledger from one block to the subsequent one)

    • Data availability (The ledger is available and hosted on all nodes)

    • Consensus (Reaching consensus about the ledger's canonical truth)

    In a monolithic blockchain design, all these tasks are being done by the Layer 1 blockchain. In a modular blockchain design, the labor is being divided between Layer 1 and Layer 2.

    This division of labor is what ultimately allows the network to scale, as both layers can focus and specialize on their dedicated task.

    READ: Proof of Stake vs Proof of Work: All you need to know ahead of the Ethereum Merge

    This allows Layer 1 to focus on appropriate security (e.g., Proof of Stake), data availability, and decentralization, which Layer 2’s role is to scale execution.

    Rollups

    The most prominent examples of Layer 2s are rollups, one of Ethereum's answers to the problem of blockchain network scalability. Rollups move the transactional burden from Layer 1 to Layer 2.

    In 2022, rollups have become extremely popular in the Ethereum community as they have emerged as Ethereum's primary scaling solution with around 95% market share.

    READ: CoinTracking integrates Yield App

    Rollups inherit Ethereum's network security and some are compatible with the Ethereum Virtual Machine, allowing dApps to migrate seamlessly and users to have an Ethereum-like experience at a fraction of the cost.

    While transactions can still be executed on Layer 1, rollups allow multiple transactions to be processed off-chain, offloading some of the burden of transaction computation.

    These are then bundled, or - rolled up - and the compressed data is posted to the main Layer (in this case Ethereum). Thus, rollups can process a batch of transactions in the same time it would take Ethereum to only process one.

    Rollups process multiple off chain transactions before submitting the transaction data to the main blockchain

    As a result, the compressed transaction data occupies much less blockspace on the main network at a fraction of the gas cost.

    READ: What is crypto arbitrage trading? Can it work as a hedging strategy?

    However, rollups must ensure the validity of the state they transmit to Layer 1. Here, rollups differ in the way they ensure the integrity of the data.

    Optimistic rollups vs zero-knowledge rollups

    The two major Layer 2 scaling solutions are Optimistic and zero-knowledge rollups (zk-rollups for short).

    Optimistic Rollups

    Optimistic rollups rely on retroactive fraud proofs to ensure the validity of data. When a batch contains a fraudulent transaction, anyone can publish a fraud proof of the incorrectly submitted data, which will then be verified by the Layer 2 smart contract.

    Economic incentives

    Similar to the PoS consensus mechanism on Ethereum, optimistic rollup (OP) validators are required to deploy a bond before they can start the validation process. Should a validator submit an invalid transaction and this is uncovered by a fraud proof, the validator may lose their bond. It is this type of incentive that encourages validators to act with integrity.

    The challenge period

    Fraud proofs can be initiated within a set time window, also referred to as the challenge period, during which the results of the rollup's transactions can be challenged. As a result, withdrawals from optimistic rollups to Layer 1 could take more than a week – one of the main disadvantages of optimistic rollups.

    READ: The Merge – What to expect from Ethereum’s long-awaited upgrade?

    The approach to verification and validity assumptions is what distinguishes optimistic rollups from zero-knowledge rollups.

    Zero-knowledge rollups

    While optimistic rollups utilize economic incentives to ensure data integrity, zk-rollups are built using math and cryptography, aka zero-knowledge proofs.

    Zero-knowledge proofs

    A zero-knowledge proof (sometimes called validity proof) is a method that allows one party to prove to another party that a statement or a piece of information is correct. What makes zk-proofs unique is that the statement which is proven to be true does not have to be revealed.

    This cryptographic innovation is not only used by zk-rollups to prove that the transactions they have processed off-chain are valid, but it has also unleashed new privacy applications that were previously unthinkable.

    For instance, zero-knowledge based digital identity solutions, such as Polygon ID, would allow users to exchange identifying information with service providers without having to disclose sensitive data such as their name or identification documents. Therefore, zero-knowledge proofs are expected to be a key technology to enable compliance for institutional DeFi applications (learn more about via the link below).

    READ: Rise of Institutional Interest in DeFi

    Zk-rollups publish validity proofs together with a summary of their transactions to Layer 1, which in turn can use these validity proofs along with the summary to reconstruct all transactions executed by the rollup, without having access to all details of the transactions.

    This reduces both blockspace and gas costs as zk-rollups do not have to transmit the entire state to Layer 1, which allows for faster transaction speeds.

    EVM compatible or app-specific chains

    Although optimistic rollups and zk-rollups are themselves smart contracts that run on the Ethereum Virtual Machine (EVM), they compute transactions on a separate, off-chain virtual machine, which itself must not necessarily be compatible with the EVM.

    When a rollup is EVM compatible, however, it allows projects to migrate their Layer 1 native protocols to Layer 2 seamlessly. Until recently, only optimistic rollups provided an EVM compatible environment, while zk-rollups were used to build application-specific chains.

    EVM compatible rollups

    • Arbitrum – General purpose OP

    • Optimism – General purpose OP

    • zkSync – The first zk-rollup that became EVM compatible under zkSync 2.0

    Non-EVM compatible rollups

    • StarkNet – General purpose zk-rollup for Ethereum’s dApps written in the Cairo programming language

    Application-specific rollups

    • ImmutableX – NFT and Web3 gaming focussed zk-rollup

    • Loopring – Decentralized exchange and payment protocol (zk-rollup)

    • dYdX – DEX supporting perpetual trading (zk-rollup)

    • Aztec Network – A zk-rollup focusing on privacy

    Polygon PoS, as part of Polygon's scaling suite, is expected to be converted from an Ethereum side-chain to an EVM-compatible zk-rollup. This development would drastically impact the rollup landscape, as the Polygon network currently secures more assets than any other rollup.

    Layer 2 metrics comparison

    Total value locked (TVL)

    The cumulative value of all digital assets deployed into a DeFi protocol or blockchain is expressed in total value locked (TVL). This metric is often watched as it indicates the overall state and health of the DeFi and/or blockchain ecosystem.

    READ: How to build a stablecoin strategy to protect and grow your portfolio

    If the value of TVL increases, it means that more people will use and trust the network because of the good and innovative practices taking place on this blockchain.

    On the day of writing (5 December 2022), $4.50 billion is locked across Layer 2 blockchains, compared to $24.75 billion being secured by smart contracts on Ethereum.

    While Arbitrum was only launched on 31 August 2021, it is the second largest L2 with $1.02 billion in TVL and is ranked 5th overall against other L1 blockchains.

    Blockchain technology secures billions of TVL

    Optimistic general-purpose rollup networks such as Arbitrum and Optimism have gained significant TVL market share since they were first to market with an EVM-compatible scaling solution, with the two accounting for over 80% of all TVL locked in Layer 2 smart contracts. However, this is expected to shrink as the first EVM compatible general purpose zk-rollups enter the market.

    READ: Stablecoins 101: How do asset pegs work?

    Layer 2s improve improve transaction throughput

    Transaction throughput and adoption

    The ultimate goal of Layer 2 scaling solutions is to increase the transaction throughput of the Ethereum network. This requires shifting the activity from the main chain to Layer 2.

    As such, transaction data is a key metric to watch in order to assess the success of a Layer 2 blockchain.

    READ: Yield App partners with Trovio Group to launch $35М DeFi fund

    During the 30 days to 5 December 2022, Arbitrum led the charge in terms of transaction volume, closely followed by Optimism.

    It is noticeable that the leading Layer 2s with the most transactions are all EVM-compatible rollups.

    Total transactions on the main layer 2 blockchains

    Transaction data shows continued Layer 2 adoption

    While Ethereum mainnet transactions have been relatively stable for the last six months at just above 1 million per day, Layer 2 transactions are on a constant uptrend.

    hgiher transactions on layer 2 than ethereum mainnet

    On 8 November 2022, Layer 2 transactions outstripped Layer 1 transactions for the first time. As Layer 2 transactions continue to grow while mainnet transactions remain stable, the broader network is processing record amounts of transactions, while gas prices on the Ethereum mainnet are on the decline.

    Lower transaction fees on Ethereum

    Fees on Layer 2

    Fees on Layer 2s are multiple times cheaper than on the Ethereum mainnet. On Arbitrum One and zkSync, for example, a token swap costs only a fraction of what it would on Ethereum – up to 34 times less, in fact.

    L2s reduce gas fees

    Developer activity on Layer 2

    Developer activity is essential for the success of any blockchain network, as their work drives the innovation of new dApps that will attract new users to the platform. Without a vibrant community of developers, a blockchain lacks the foundation to innovate in a competitive industry and is at risk to fail.

    READ: What are liquidation cascades in crypto?

    In Q3 2022, the two largest Layer 2s by TVL, Arbitrum and Optimism, saw substantial growth in active developer teams.

    More developers work on ethereum scaling solutions

    Drivers of Layer 2 adoption

    Lower gas fees

    The high gas fees on the Ethereum mainnet became a major barrier that precluded some users from participating in the network. This led to a migration to alternative EVM compatible Layer 1 blockchains that lured users with lower gas fees. Today, however, Layer 2 blockchains are able to attract these users with similar benefits, at the same time allowing them to remain in the Ethereum ecosystem.

    Easier onboarding

    Some of the more popular exchanges, like Binance and Coinbase, now allow users to withdraw their funds directly to Arbitrum and Optimism. Consequently, it has become simpler for users to onboard into those scaling solutions.

    New use cases

    Zk-rollups enable privacy-centric use cases to be built into scalable applications.

    Unique dApps on Layer 2

    While Arbitrum and Optimism provide a friendly environment for projects into which to migrate their Layer 1 protocols, new dApps have emerged that are exclusively available on Layer 2, such as GMX.

    READ: Interview with an expert: Quoc Bao Ngo, Founder of MyReality DAO

    GMX is a decentralized spot and perpetual exchange that offers low swap fees, zero slippage, and up to 50x leveraged positions. As one of the most popular protocols in the Arbitrum ecosystem, surpassing Uniswap's generated fees for the first time on 28 November 2022, GMX is a prime example of how dApps can benefit from a low-fee environment by reducing friction and attracting new users to the entire ecosystem.

    GMX utilized layer 2 solutions to reduce fees on token swaps

    Conclusion

    Layer 2 scaling solutions are growing in popularity as the user and onboarding experiences continue to improve. Lower fees associated with popular and exclusive dApps have contributed to this trend, while increasing developer activity will further support it.

    All of these factors promote the adoption of Layer 2 blockchains, allowing them to appeal to users that previously would have migrated to alternative Layer 1 blockchains.

    Outlook: Synergies between Layer 1 and Layer 2

    While the Layer 2 landscape continues to evolve, Ethereum developers continue to focus their efforts on their rollup-centric roadmap. With the next planned upgrade, EIP-4844, Ethereum will remove one of the remaining bottlenecks to Layer 2 scaling by providing rollups with more and cheaper data reserved specifically for these solutions.

    READ: Ethereum scaling solutions: All you need to know about future plans to scale the Ethereum network

    If both Layers continue to make great strides, discussions about elevated gas costs could well become a thing of the past. We will watch with great interest as this space continues to develop and evolve.

    Do you want to earn a secure and sustainable yield on your digital assets? Sign up for a Yield App account today!



    DISCLAIMER: The content of this article does not constitute financial advice and is for informational purposes only. The price of digital assets can go down as well as up, and you may lose all of your capital. Investors should consult a professional advisor before making any investment decisions.

 

Share:

Unlock the full potential of cryptocurrency and grow your digital wealth


Unlock the full potential of cryptocurrency and grow your digital wealth