Skip to content

Optimistic Rollups: A solution to scale while maintaining decentralization and security

As distributed networks evolve, the challenge of scaling without compromising decentralization and security remains an important priority. In this scenario, optimistic rollups emerge as a key solution that allows these networks to handle more transactions more efficiently while preserving the essential principles that define them.

In this article, we will discuss how this technology strikes a balance between scalability, security and decentralization, analyzing in detail its architecture and the benefits it brings to the distributed network ecosystem.

What are Optimistic Rollups?

Optimistic rollups are a L2 scalability solution designed to process transactions outside the main chain (L1). The term “optimistic” refers to their approach: they assume that all transactions are valid unless proven otherwise. Instead of validating each transaction individually on the L1, rollups group multiple transactions and execute them off-chain, reducing congestion and processing costs.

This process is complemented by a fraud-proof mechanism that ensures that any incorrect transactions can be challenged and corrected. Thus, optimistic rollups do not publish proofs of validity for batches of transactions on the main chain, but rely on this fraud scheme to detect errors. If a valid fraud proof is presented, the protocol re-executes the transactions and updates the rollup status. If the batch is not challenged after the challenge period, it is considered valid.

This methodology allows optimistic rollups to provide significant scalability improvements by processing transactions outside of the main chain and publishing only the necessary data, offloading the main chain and improving performance.

The blockchain trilemma

One of the biggest challenges in distributed networks is the blockchain trilemma, which states that improving one aspect – scalability, decentralization, or security – often means compromising one of the others. Optimistic rollups seek a balance among these three elements:

  • Decentralization: Optimistic rollups allow any participant to challenge suspicious transactions, avoiding the concentration of control in a single node or entity.
  • Security: Although transactions are not immediately validated on the main chain, the fraud-proof mechanisms ensure that erroneous transactions are corrected before they affect the state of the network, preserving its integrity.
  • Scalability: By processing transactions outside the main chain and publishing only the necessary data on the L1, optimistic rollups achieve greater processing capacity, improving network performance without saturating the main chain.

How do optimistic rollups work?

The operation of optimistic rollups is based on a fraud-proof mechanism that publishes the minimum necessary data on the L1 without immediately validating all transactions. This approach optimizes efficiency by allowing transactions to be processed quickly off-chain, while giving users the opportunity to challenge erroneous transactions.

Process of a transaction in an Optimistic Rollup

The process of a transaction in an optimistic rollup is divided into three main phases:

  1. Asset deposit: The user deposits their assets in a bridge contract with L1. This contract sends the deposit information to L2, where a representation of the asset is assigned to the user within the rollup system. This step establishes the link between the assets deposited in L1 and their equivalent in L2.
  2. Transactions in L2: The user can perform transactions within L2, which are grouped into blocks by the sequencer. They are then published to L1 as a single compressed transaction. Status roots in L1 reflect the status of the rollup before and after execution, providing transparency.
  3. Withdrawal of funds: To withdraw funds from L2, the user must provide a Merkle proof that their transaction was correctly included in the state root. Before completing the withdrawal, they must wait for the challenge period, during which other participants can challenge the validity of the transaction.

Essential Rollup Components

The process within an optimistic rollup involves several actors and components that are essential to its operation:

  • Sequencer: Responsible for grouping user transactions into blocks and organizing them in an immutable and transparent manner. This ensures a clear chronological record of transactions, optimizing network efficiency.
  • Proposer: Applies transactions to the system’s virtual machine, creating a new state. This state is publicly committed and recorded in the rollup contract on L1, ensuring the integrity of the information.
  • Challenger: Has the ability to challenge the validity of the committed state. If the state is proven incorrect by a fraud proof, the system corrects the error, ensuring that fraudulent transactions do not impact the network.

Fraud Proof

Fraud proof is the key mechanism that ensures the security of the system. If fraud is detected in the status transition of a transaction batch, any participant can challenge it. If the challenge is valid, the entire batch is reviewed, the fraudulent actions are reversed, and the rollup status is adjusted. This process ensures that any fraudulent behavior is corrected before it affects the system.

Advantages of Optimistic Rollups

Optimistic rollups provide a number of advantages to improve the scalability of distributed networks:

  • Increased scalability: They enable faster and more efficient transactions, increasing transaction processing capacity and improving user experience by enabling a higher volume of transactions per second. They also provide significant scalability improvements without sacrificing security.
  • Reduced costs: By processing fewer transactions on the main chain, fees are lower, making distributed applications more affordable.
  • Flexibility for developers: Optimistic rollups support EVM and Solidity, making it easier for developers to build and port distributed applications.
  • Security and transparenc: Transaction data is stored on the L1 chain, improving transparency, security, and tamper resistance.

Disadvantages of Optimistic Rollups

Despite their advantages, optimistic rollups also have some disadvantages:

  • Challenge period: There is a waiting period, usually one week, during which transactions can be challenged, which can affect the immediate availability of funds.
  • Finality delays: There may be delays in transaction finality due to potential fraud challenges, resulting in slower transaction times compared to on-chain transactions.
  • Influence of centralized operators: Sequencers, if centralized, can influence the order of transactions, affecting the fairness of transaction management.
  • Security risks: Although secure, the trust model can be vulnerable to attacks, especially if a malicious operator attempts to exploit the challenge period. In addition, the security of the rollups depends on the integrity of the smart contracts, which can represent a risk if they are compromised.

Conclusion

Optimistic rollups are an effective solution for improving the scalability of distributed ledger technologies (DLTs), especially in the context of blockchains, allowing transactions to be executed outside the main chain (L1) while guaranteeing their validity. They use a gas-rate scheme similar to mainchains, optimizing costs through calldata compression and stateful writing, offering users a cheaper and more efficient experience compared to the high fees of the L1.

In the context of Ethereum, data sharding using the Danksharding technique is expected to further improve the scalability of optimistic rollups. By increasing the amount of space available on the L2 to publish per-block data, and by using cheaper, non-permanent “blob” storage, the current block space limitations will be alleviated.

In future articles, we will look at other Layer 2 solutions, such as ZK-rollups, to understand how these technologies can coexist on the same DLT and contribute to scalability and efficiency.

In addition, there is an educational video from YouTube with a visual and detailed explanation of the operation of optimistic rollups.



Resources:
[1] Ethereum.org – Optimistic Rollups
[2] Ethereum.org – Scaling Optimistic Rollups / disputing transactions
[3] Optimism – Rollup Protocol Overview
[4] Chainanalysis – Optimistic Rollups defined
[5] Ledger – Optimistic Rollups
[6] Geeksforgeeks.com – What are Optimistic Rollups


FAQs

What are optimistic rollups?

Optimistic rollups are second-layer (L2) scaling solutions that bundle transactions to improve efficiency without sacrificing security.

What are the advantages of optimistic rollups?

They offer significant improvements in scalability, cost reduction, improved user experience and greater transparency.

What are the disadvantages of optimistic rollups?

They include delays in finality, centralization of operators, and security risks if there are no honest nodes.

How do fraud proofs work in an optimistic rollup?

They allow users to challenge invalid transactions. When a verifier detects a potentially fraudulent transaction, it initiates a challenge and the transaction is replayed in a controlled environment. If the result does not match what is expected, the lot is rolled back and the previous state is restored.

What is the difference between fraud proofs and validity proofs?

Fraud proofs are calculated within the main chain, allowing any participant to challenge the validity of a batch of transactions if they believe it to be fraudulent. On the other hand, validity proofs (such as SNARKs or STARKs) are generated outside the main chain and verified by the main chain, providing instant verification.

What happens if no one disputes a fraudulent transaction in an optimistic rollup?

If no one disputes a fraudulent transaction within the dispute period, the transaction is considered valid and the status is updated, even if it is incorrect.

Why do optimistic rollups have a dispute period?

The dispute period gives verifiers time to identify and dispute any incorrect transactions before the new status is confirmed.

How do optimistic rollups affect decentralization?

While they improve scalability, they can concentrate certain aspects, such as sequencer control, if there are no mechanisms in place to encourage more distributed participation.

Are optimistic rollups just for Ethereum?

No, it is a platform-agnostic technology. While they are popular on Ethereum, they can be applied to any DLT that supports smart contracts and off-chain and on-chain verification.

What role will danksharding play in the scalability of rollups?

Danksharding will increase the space available to publish data per block, improving processing capacity.

How do commissions work in optimistic rollups? 

Commissions are calculated by combining multiple transactions into a single batch, resulting in a lower cost per user compared to individual transactions made directly on the main chain.

Is it possible for an operator to shut down the system and take the funds?

Yes, there is a risk involved. Security depends on protection mechanisms and trust in the operator, so it is important to choose rollups with a solid track record.



At Block&Capital, specialists in tech recruitment, we strive to create an environment where growth and success are within everyone’s reach. If you’re ready to take your career to the next level, we encourage you to join us.