Ethereum L2 Solutions vs Rollups — Understanding the Difference

Ground Zero
9 min readJan 13, 2023

--

We cover the basics of Ethereum L2 Solutions and Ethereum Rollups and explain the difference between the two terms.

What are the Ethereum L2 Solutions?

In the context of cryptocurrency, an L2 solution refers to a “second-layer” solution built on top of a blockchain network. Such solutions aim to improve the scalability of the blockchain by allowing for off-chain transactions. These transactions are settled on the blockchain only when necessary, such as when a dispute arises. Examples of L2 solutions include the Lightning Network for Bitcoin and the Raiden Network for Ethereum. These solutions aim to improve transaction speeds, reduce costs, and increase the overall throughput of the blockchain network.

What are the Ethereum Rollups?

A Rollup is a type of second-layer scaling solution that aims to improve the scalability of a blockchain network by allowing for off-chain transactions to be “rolled up” and periodically committed to the blockchain.

A rollup works by creating a specialized smart contract, known as a “rollup contract,” which is responsible for maintaining a running record of the current state of all the off-chain transactions. These transactions include both the transfer of assets and the execution of smart contracts. When a user wants to initiate a transaction, they send the details of the transaction to the rollup contract, which verifies the transaction and then adds it to the current state. This process continues as more and more transactions are added to the rollup contract.

The rollup contract periodically publishes the current state of all the off-chain transactions to the blockchain, which is known as “commitment.” This process serves as a proof that the off-chain transactions are valid, and the assets can be moved accordingly.

So what is the difference between the L2 Solutions and the Rollups?

L2 solutions and rollups are related but distinct concepts.

L2 solutions, or “second-layer solutions,” are a set of technologies and techniques that are built on top of a blockchain network to improve its scalability, privacy, and cost-effectiveness. They allow for off-chain transactions that are settled on the blockchain only when necessary, such as when a dispute arises.

Rollups, on the other hand, is a specific type of L2 solution that utilizes a smart contract to record the state of off-chain transactions and periodically commit them to the blockchain. Rollups move the execution of smart contracts and transactions off-chain, into a specialized smart contract called a “rollup contract.”

So in summary, L2 solutions are a broader category of technologies that are used to improve the scalability and performance of a blockchain network, while rollups is a specific implementation of L2 solution that uses smart contract to record the state of off-chain transactions and periodically commit them to the blockchain.

How do Ethereum L2 solutions work?

L2 solutions work by creating a network of payment channels on top of a blockchain network. These channels allow for off-chain transactions between users without the need for every transaction to be recorded on the blockchain.

For example, in the case of the Lightning Network for Bitcoin, two parties that wish to transact with each other can open a payment channel between them. They can then make as many transactions as they want within the channel without needing to broadcast each one to the blockchain. When either party wants to close the channel, the final state of the channel, including the latest balance for each party, is broadcast to the blockchain and the funds are moved accordingly.

Another example is state channel, which allows a group of parties to interact with smart contract off-chain as well as keep track of their mutual balance, this solution can be applied on decentralized financial (DeFi) use-case such as lending, borrowing and swapping assets.

These payment channels and off-chain interactions greatly increase the scalability of the blockchain by reducing the number of transactions that need to be recorded on the blockchain. Additionally, they can also improve privacy and reduce transaction costs.

So in short it is a way to keep most of the transaction off-chain and only settle on-chain when required.

How do rollups on Ethereum work?

Rollups on Ethereum are a type of second-layer scaling solution that allow for off-chain transactions to be “rolled up” and periodically committed to the Ethereum blockchain.

Rollups work by moving the execution of smart contract-based transactions off-chain and into a specialized smart contract, known as a “rollup contract.” This contract is responsible for maintaining a running record of the current state of all the off-chain transactions, including the current balances of all the relevant addresses.

When a user wants to initiate a transaction, they send the details of the transaction to the rollup contract. The rollup contract verifies the transaction and then adds it to the current state. This process continues as more and more transactions are added to the rollup contract.

The rollup contract periodically publishes the current state of all the off-chain transactions to the Ethereum blockchain, which is known as “commitment.” This process is done at a scheduled time or based on the number of transaction done. The commitment contains the Merkle proof that proves the correctness of the off-chain data.

This process enables a large number of transactions to be processed off-chain, resulting in a greatly increased transaction throughput and reduced gas costs for users. Additionally, rollups can also enable new types of complex smart contract-based applications that would not be possible on the base-layer Ethereum blockchain.

There are two types of rollup: Optimistic rollup and ZK rollup, the basic idea is the same, but the security level, complexity and cost are different

An example of an L2 transaction on Ethereum?

An example of an L2 transaction on Ethereum?
  1. Alice wants to send 1 ETH to Bob. She creates a transaction and sends it over a L2 channel, for example a State channel, between them, which does not require to be broadcasted on the blockchain.
  2. Both Alice and Bob sign and exchange the updated balance of their channel, reflecting the transfer of 1 ETH from Alice to Bob.
  3. When either party wants to close the channel, they can submit the latest balance of the channel to the Ethereum mainchain, and the funds are moved accordingly.

Please note, this is a simplified example and in practice there might be more complexity in the process, such as dispute resolution, fraud proofs, and many other nuances depending on the specific implementation of L2 solution. Additionally, there are many different types of L2 solutions like Rollups, State channels, Sidechains and more, each with their own specific process, but the basic idea is the same, to keep most of the transactions off-chain and settle on-chain when required.

An example of a Rollup transaction on Ethereum?

Sure, here’s a simplified example of a rollup transaction on Ethereum:

  1. Alice wants to send 1 ETH to Bob. She creates a signed transaction that includes the details of the transfer (e.g., the amount, the addresses of the sender and receiver) and sends it to the rollup contract.
  2. The rollup contract verifies the validity of the transaction, including checking the signature of the transaction to confirm that it was created by Alice and that the transaction is valid according to the rules of the rollup contract.
  3. The rollup contract updates the current state of the off-chain transactions to reflect the transfer of 1 ETH from Alice to Bob. This is done by updating the balances of the relevant addresses in the state.
  4. The rollup contract publishes a commitment to the Ethereum blockchain that includes a Merkle proof of the current state of the off-chain transactions. This commitment serves as a proof that the off-chain transactions, including the transfer of 1 ETH from Alice to Bob, are valid.
  5. Once the transaction has been included in the Ethereum blockchain, Bob can now see the 1 ETH in his account, and the transaction is considered complete.

What are the most popular L2 solutions for Ethereum?

There are several popular second-layer scaling solutions (L2) for Ethereum, each with their own unique features and trade-offs. Some of the most popular include:

  • Rollups: Rollups, as I have explained before, move the execution of smart contracts and transactions off-chain, into a specialized smart contract called a “rollup contract,” which periodically publishes the current state of the off-chain transactions to the Ethereum blockchain. Examples of popular rollup solutions for Ethereum include Optimism, ZK-Sync and Polygon.
  • State Channels: State channels are a form of L2 scaling that allow two or more parties to transact off-chain, by creating a channel between them and updating their respective balances as they transact. An example of this is the Counterfactual framework, which is a set of smart contract building blocks and patterns that makes it easy to create state channels-based dApps.
  • Plasma: Plasma is a scaling solution that builds a tree of child chains on top of the Ethereum mainchain. Each child chain can process its own transactions, and periodically “submit” its state to the mainchain. An example of this solution is OmiseGo’s Plasma implementation.
  • Sidechains: Sidechains are independent blockchains that are pegged to the Ethereum mainchain, which allows for the transfer of assets between the two chains. An example of this is xDai chain which is an Ethereum sidechain with its own token, xDai, that is pegged to the value of DAI.

What are the most popular rollups on Ethereum?

There are several popular rollup solutions currently being built and used on the Ethereum blockchain. Some of the most notable include:

  • Optimism: Optimism is an open-source rollup platform that enables fast and cheap transactions through the use of optimistic virtual machines (OVMs). Optimism aims to bring the full functionality of the Ethereum mainchain to layer 2, and it also allows for running smart contracts on the rollup.
  • ZK-Sync: ZK-Sync is a zero-knowledge rollup (ZK rollup) platform that allows for private, low-cost transactions on Ethereum. ZK-Sync uses zk-SNARKs, a form of zero-knowledge proof, to ensure the privacy and security of transactions, and it also enable high-throughput smart contract execution.
  • Polygon (formerly Matic): Polygon is an Ethereum scaling solution that uses a network of sidechains, known as “child chains,” to increase the transaction throughput of the Ethereum network. The network uses a form of rollup, called a Plasma rollup, that allows for fast and inexpensive transactions on the child chains while still remaining secure and transparent.
  • Loopring: Loopring is an open-source protocol for building decentralized exchanges (DEXs) and other decentralized finance (DeFi) applications. The protocol uses zkRollup, to move the execution of smart contracts and trades off-chain, which allows for faster and cheaper trades than on-chain execution would allow.

So is Polygon a Rollup or an L2 Solution?

Polygon (formerly known as Matic) is both a rollup solution and a second-layer scaling solution for Ethereum.

Polygon is an L2 scaling solution that uses a network of sidechains, known as “child chains,” that are pegged to the Ethereum mainchain. Each child chain can process its own transactions independently, but the state of these child chains is periodically committed back to the mainchain through a process known as “Plasma exit.” This allows for increased transaction throughput and reduced gas costs for users, as well as enabling new types of smart contract-based applications that would not be possible on the mainchain.

At the same time, Polygon also utilizes rollup to further increase the scalability and efficiency of the child chains by moving the execution of smart contracts and transactions off-chain, into a specialized smart contract called a “rollup contract.” This contract verifies and maintains the current state of the off-chain transactions, and periodically commits the state to the mainchain.

For more articles, analysis and news, follow Ground Zero on Telegram and Twitter.

Cheers,

  • The Ground Zero team

--

--

Ground Zero

Supporting innovative blockchain solutions and ideas, fundraising to market positioning and adoption.