Blockchain Layer 2’s and Scaling Solutions-Ethereum

Mustafa bedawala
CodeX
Published in
10 min readJun 18, 2022

This post will assist in developing abstract models of how the various scaling solutions differ and where they are similar.

Table of Content 
·
Acknowledging the existing monolithic blockchain challenge
·
Knowing Layer 2's and Scaling Solution
State & Payment channels
Plasma Chain
Sidechain
Optimistic rollups
ZK-rollups
·
Final Thoughts
·
Miscellaneous

Acknowledging the existing monolithic blockchain challenge

Most people now agree that the most successful and long-term way to scale blockchains is to stack other protocols on top of the primary chain in a multilayered approach, where higher-layer networks are introduced to boost functionality or throughput without sacrificing the authenticity of the base layer.

This is similar to how the internet scales, with HTTP constructed on top of TCP/IP, HTML written on top of HTTP, and so on.

Explaining Image below — Intel’s fastest CPU in 2019 was the Xeon Platinum, a 28-core processor that cost $10,000 “Monolithic”. AMD came up with a challenger, a 64-core CPU that cost $4,000 and utterly destroyed Intel’s best “Modular”. For half the price, you can get double the performance. That’s right: a fourfold increase in an industry where you’d expect a twofold increase in 18 months at most. AMD EPYC CPUs outperformed the competition in practically every parameter, including performance, performance per watt, and effectiveness per dollar.

Consider an Intel processor before 2019 as a Monolithic Blockchain. This is how blockchains currently work. They handle all of their own security, data availability, and execution.

Other forerunner arrangements exist, such as merge-mined chains and commit chains, although they all fall within the monolithic category.

The essential question is if your chain 1 fails, can you recreate its state from another chain 0? If the answer is no, the chain is monolithic. In short Chain 0 is responsible for consensus, data availability, and execution.

Bitcoin, Ethereum, and Polygon PoS are a few examples.

We have multi-chain ecosystems like Cosmos under the monolithic category, where numerous monolithic chains partition the same validator set. Or sharded ecosystems, such as Polkadot, in which several chains use the same validator set. More information can be found here and here.

Source — The Block

Astonishingly on Ethereum, the total value settled in 2021 was $7.7 trillion, representing a 500% rise year on year. Stablecoins, interestingly, represented an estimated $4.2 trillion (54 %) of the overall value settled.

To put this in context, the total purchase volume facilitated by credit card networks such as Visa ($8.9 trillion in 2020) and Mastercard ($4.7 trillion in 2020). It vastly outnumbers the total payment volume processed by fintech payment facilitators like PayPal ($1.3 trillion in 2021). Finally, it accounted for over 1% of the entire amount settled through the Federal Reserve’s Fedwire settlement system ($991 trillion in 2021).

One of the key tenets of the Ethereum mission is that it should be a global platform open to anyone. Scaling issues in its existing layer-1 design prohibit it from reaching this objective. Due to the platform’s high transaction fees, many users have simply been unable to interact with it.

Eth's Lowest average transaction fee of $0.00072 was on Wednesday, October 21, 2015, and Eth's Highest average transaction fee of $200.06 was on Sunday, May 1, 2022

Source- Etherscan

Bitcoin blocks are published every 10 minutes on average, whereas Ethereum blocks are published every 13 seconds. However, transfer settling times are lengthier in practice (as most recipients will require several confirmations or blocks built on top of the block containing the transfer, before considering the transfer to have settled.)

Coinbase, for example, requires 3 confirmations (30 minutes) for BTC transactions and 35 confirmations (7.5 minutes) for ETH deposits. Thus, “settlement time” differs from “block time,” and must consider both the robustness of the blockchain’s security and its “speed.”

Vitalik wrote on the issue of higher fees and an unpleasant user experience

Several Ethereum Improvement Proposals (EIPs) are being developed to optimise Ethereum’s basic layer-1 platform for use by various layer-2 networks. They include EIP 4488, which is expected to cut the cost of putting layer-2 transactions onto Ethereum by a factor of 5x, and EIP 4844, which will introduce a new transaction format in preparation for data sharding, potentially resulting in fee savings of up to 100x for rollups.

The image below depicts how inexpensive it is to do various tasks on specific L2s when compared to the Ethereum mainnet

Because of L2s, consumers can finally enjoy minimal fees when utilising their favourite web3 applications, a significantly better UX emerges since transaction confirmations are nearly instant (due to L2 sequencers), and blockchains can be substantially scaled.

This will make access to immutable block space considerably more affordable and will help democratise the network for new users by providing simple and straightforward applications that abstract away all complications.

Scaling not only allows for more users, which increases the value of a network exponentially, but it also allows for more computationally expensive operations to be performed on-chain, which continues to expand the application design space and makes new web3 use cases economically and technically feasible.

Knowing Layer 2's and Scaling Solution

Aside from the side chain and the Plasma chain, which should not be considered pure L2 because of its own security chain, such as polygon POS. An L2 (layer-two) scaling solution has a distinct execution layer (where code runs, i.e. EVM) that inherits the security guarantees and decentralisation of the network it’s operating on top of, in our instance, Ethereum.

This means that if the L2 goes down due to a bug, infrastructure attacks, or outage, the monies are safe and secure under a smart contract bridge.

The image below depicts how Ethereum scalability is linked to various alternatives, mostly on-chain and off-chain options. Off-chain solutions are discussed in this post since the sharding roadmap is still being developed by the researcher because the main focus is still on “the merge” event

Source- Image Credit: u/emkoscp

As a newcomer, it might be difficult to form a mental model of how each of these differs and where they are similar. The figure below helps to visualise how the various scaling options like State channel, ZK rollups, Optimistic rollups, plasma and side chain are linked to the Block headers i.e., state root with other details that we often neglect to conceptualise

Source- Samlafer

Off-chain scaling frameworks that are currently drawing developer interest can be divided into five categories:

  • State & Payment channels-

In summary, state channels enable participants to transact off-chain an endless number of times while only committing the initial and final states to the mainchain when the channel is closed. Payment channels, such as the Lightning Network, are a subset of state channels that refer to more generalised, smart contract-based transactions.

The Lightning Network, a layer-2 state channel protocol used for payments, including micropayments and cross-border remittances, and the Liquid Network, a sidechain used by exchanges and traders for speedier settlement, are two scaling alternatives for Bitcoin that have found significant usage.

Lightning is the primary implementation of a state channel scaling protocol that has lately gained popularity. Recent growth can be ascribed to the availability of Lightning Network hardware and software solutions such as Umbrel, Bluewallet, and Strike, as well as initiatives to push Lightning Network adoption among individuals and nations.

  • Plasma Chain -

Plasma uses smart contracts to enable the construction of “child chains,” which are effectively smaller clones of the Ethereum blockchain that are arranged in a chain hierarchy.

Each chain has its own fraud-proof mechanism that allows users to switch to the main chain if node operators are dishonest. Following its introduction in 2017, multiple variants of the Plasma framework were released, and it was widely recognised as the de-facto scaling solution for much of 2018.

Plasma includes escape methods that allow users to return assets to the main chain even if the central operator is hostile. That means that if users pay attention, they will always have an advantage against a Plasma operator and will be able to keep their tokens safe.

Furthermore, Plasma chains have withdrawal durations of 7–14 days (typical of fraud-proof-based scaling methods) and do not support general-purpose computation.

Source — Plasma Whitepaper

Following the initial surge of developer interest in Plasma, most protocols have either abandoned Plasma in favour of rollups or developed hybrid techniques that incorporate other scaling frameworks.

  • Sidechain-

In summary, sidechains can run in parallel with the base layer, but they are separate blockchains with their own consensus method and security attributes.

Sidechains are autonomous blockchains that operate in parallel with the base layer via embedded connectivity but have their own operators, validators, and security procedures. Sidechains’ versatility enables fast installations to accommodate high-throughput and low-latency transactions for users.

Some critics argue that because sidechains use their own consensus models, they are not properly “Layer-2,” and instead function as a distinct, scalable L1. Sidechains, on the other hand, can be designed in a variety of ways, and there should be a distinction between those that are correctly aligned with and complementary to the base layer and those that aren’t, but this distinction isn’t always evident.

The image below depicts a framework for comparing Ethereum Scaling solutions

Source — Matter Labs
  • Optimistic rollups-

Rollups reduce and compress transaction data in rollup blocks before submitting it to the blockchain. In the best-case scenario, optimistic rollups presume that submitted transactions are genuine by default; only if the submission is contested will calculations on the mainchain be conducted to establish where the fraud happened.

Optimistic rollups (ORUs), like the Plasma framework, rely on fraud proofs, a security paradigm in which processing for transaction validation does not occur on the L1 mainnet unless the proof is disputed.

Optimistic rollups get their name from the fact that the sequencer’s batch of transactions is deemed to be genuine by default: only in the event of a dispute would the calculation of each transaction included in the rollup block be completed on the mainchain to assess whether fraud occurred.

Participants must wait a week before withdrawing their assets stored in an optimistic rollup in order for one to validate or challenge the submitted transaction batches.

Source
  • ZK-rollups-

Zero-Knowledge cryptography is one of the most noteworthy developments in computer science in the last fifty years. ZKPs have unique qualities that make them crucial components of several blockchain scaling and privacy solutions, such as ZK rollups like StarkNet, private ZK rollups like Aztec, and Layer 1 chains like Mina, Filecoin, and Aleo.

Unlike optimistic rollups, zero-knowledge rollups include proofs for every state transition up front, making it nearly difficult for operators to commit an incorrect state.

Relayers (also known as provers) act as the aggregator for ZKRUs. Rollup transactions are aggregated by relayers before being transmitted to the mainchain. Relayers, unlike sequencers, are responsible for executing all computations to construct the zk–SNARK proof (zero-knowledge Succinct Non-interactive Argument of Knowledge), which only shows a piece of the final hash but not the actual data itself.

The SNARK proof compares a snapshot of account values on the blockchain before and after the transactions. The network verifiers can then validate only the given proof rather than all of the embedded transactions (i.e. “zero-knowledge” of the complete data is required).

Because of the enormous amount of expensive math operations, ZKPs are slow and expensive to make. They can, however, be accelerated by 10–1000x with the use of specialised hardware such as Field Programmable Gate Arrays (FPGAs) and Application Specific Integrated Circuits (ASICs). More info can be found here.

Final Thoughts

According to Ethereum’s long-term vision, users will not interact with the Ethereum mainnet on a regular basis because it will solely serve as a data availability layer for L2s. That is, modular blockchains are the most economically and technically viable long-term scaling design option, and Ethereum is currently the dominating blockchain in the modularity realm, as it has very high security, which will dramatically enhance with the conversion to PoS “The Merge.”

In addition, Ethereum is growing as an L1 with data sharding, verkle trees, statelessness, and other modifications, while L2s are working to establish a shared cross-L2 communication infrastructure that will allow them to have shared liquidity and smart contract composability.

Miscellaneous

The image below depicts various Miannet launches by different protocols of various scaling solutions, demonstrating that we have all come a long way in terms of research and development, and as Ethereum scales on the base layer through data sharding and other EIPs, Zero-knowledge roll-ups and the like will evolve as well

Source — Galaxy Digital

The two images below are from “L2BEAT,” the leading dashboard for calculating how much TVL is in Ethereum L2s. One of the best aspects of L2beat is that it displays the sort of scaling technology utilised within the L2 as well as the purpose it is now serving

L2BEAT
L2BEAT

Disclaimer: This post is solely for informational reasons. It is not investment advice, nor is it a suggestion or solicitation to purchase or sell any investment, and it should not be used to assess the merits of making any investment decision. It should not be used to provide accounting, legal, or tax advice, or to make financial recommendations. The opinions expressed herein are subject to change without notice.

--

--

Mustafa bedawala
CodeX
Writer for

Chartered Accountant, CS (P), Thinker, Learner, and Observer