Layer 2 is the name given to scaling solutions built on the Ethereum blockchain, offering faster and cheaper transactions! This article will cover the current solutions and how they work.
What is Layer 2?
Layer 2 (L2) refers to scaling solutions built on the Ethereum blockchain (AKA Layer 1). The solutions aim to make Ethereum transactions cheaper and faster.
There are several types of L2. At a high level, they all work by moving the bulk of transactions away from Layer 1 while still maintaining a link to it. This allows them to benefit from some of Ethereum’s properties - e.g. its security - while bypassing much of its network fees (‘gas’).
Layer 2 is in huge demand because gas prices on L1 have grown significantly as Ethereum has become ever busier. Gas is required for every Layer 1 transaction.
Types of Layer 2 solution
Currently, there is a wide selection of Layer 2 solutions. To understand them and how they differ, let's explore:
Rollups execute trades off-chain away from Layer 1. The transactions made off-chain then get compressed or “rolled up” into a smaller transaction. This smaller transaction then gets sent back to Layer 1, allowing rollups to inherit the security of Layer 1 while alleviating network congestion.
There are two types of rollup: Zero knowledge (ZK) and Optimistic.
ZK rollups generate a SNARK (Succinct Non-interactive Argument of Knowledge) to send to Layer 1. A SNARK is cryptographic proof that the transactions made off-chain are valid. This process is known as validity proof. When the transactions are "rolled up" and sent to Layer 1, it contains this proof. As these transactions contain this proof, Layer 1 understands that they have happened. This makes transfers between Layers 1 and 2 near frictionless.
Examples of ZK rollups: zkSync, Loopring and Starkware.
We’re starting with zkSync for our Layer 2 wallet. Join here for early access and entry to the $285K crypto sweepstakes.
Here's our CEO on our rationale for starting with zkSync.
Optimistic rollups, in contrast, don’t use validity proofs. By default, optimistic rollups assume that the transactions sent to Layer 1 are valid. If someone believes that a fraudulent transaction has occurred, they can challenge it using a fraud proof—a fraud proof analyses the transactions to see if a fraud has occurred. If a fraudulent transaction is spotted, it gets reversed.
Optimistic rollups can process more transactions when compared to ZK rollups. But, if a transaction gets challenged, users can wait up to a week to withdraw their funds from Layer 2 to Layer 1. This may shorten in the future as the technology improves.
Examples of optimistic rollups are: Optimism, Arbitrum and Cartesi
Validium solutions are like ZK rollups, but the data storage happens off-chain and not on Layer 1. By sending data off-chain rather than on-chain, it reduces the cost of each transaction and increases the transactions per second (tps).
There is a trade-off, though. By storing data (user balances) off-chain, it improves the transaction throughput and scalability. But this requires trust in the third party who could prevent users from accessing their balances.
StarkWare aims to solve this with a Data Availability Committee (DAC), a committee of 8 independent members that have their own copy of the transactions made. They are also required to maintain this data by making it available at all times. If an operator prevents a user from accessing their funds, a committee member can override them to confirm their request if it is valid.
Examples of where Validium is used: Loopring and Starkware
Comparing scaling solutions
Each Layer 2 solution comes with trade-offs designed for a specific purpose. This table created by the Matter Labs teams compares each solution side-by-side.
This table has been grouped into four categories:
- Performance/ Economics
The full article is linked here, which has all the analysis of the Matter Labs team.
Argent and Layer 2
We'll launch our Layer 2 wallet later in summer 2021. Here's why we chose this option over alternatives. In short, it offers low gas, high speeds, and you get the security and finality of Ethereum.
Join here for early access and entry to the $285K crypto sweepstakes.
Making Sense of Layer 2 by Josh Stark (Devcon4)
An Incomplete Guide to Rollups
The Tim Ferriss Show with Vitalik Buterin
Validium And the Layer 2 Two-By-Two by Build Blockchain Tech
Mihailo Benjic and Sandeep Nailwal of Polygon discussing Polygon’s approach to scaling
Layer 2 scaling on Oculus Quest 2!? Loopring, Matic, Aavegotchi and Synthetix - a fun explainer on Layer 2 scaling by The Defiant
Ready to get started with DeFi?
Argent is a simple, secure, all in one wallet for investing in DeFiDownload Argent
What is Ethereum 2.0?
An exciting upgrade to the Ethereum blockchain improving scalability, sustainability and security!
What are sidechains?
Explaining how sidechains provide an alternative scaling solution for Ethereum
What is EIP-1559?
More predictable fees, greater usability and putting deflationary pressure on Ethereum