TL;DR:Optimistic rollups assume transactions are valid by default (“optimistic”), execute them off-chain for speed and cost savings, then post transaction data to Ethereum L1. A 7-day challenge period allows anyone to prove fraud if invalid transactions are submitted.
🎯 What is an Optimistic Rollup?
An optimistic rollup is a Layer-2 scaling solution that:- Executes transactions off-chain (on L2) for speed and low cost
- Posts transaction data to L1 for security and data availability
- Assumes transactions are valid by default (optimistic)
- Allows fraud proofs to challenge invalid state transitions
Key Insight
🏗️ Core Concepts
1. Off-Chain Execution
- The Problem
- The Solution
- Example
Ethereum L1 is expensive because:Every transaction must be:
- Executed by all validators (~1 million nodes)
- Verified by all nodes
- Stored permanently on-chain
2. Data Availability on L1
All Data Goes to L1
Every L2 transaction’s data is posted to Ethereum L1What gets posted:
- Transaction inputs (to, value, data)
- Signatures
- Transaction ordering
- Anyone can reconstruct L2 state from L1 data
- Data cannot be hidden or censored
- If sequencer disappears, users can recover
Compressed for Efficiency
Data is compressed before posting to L1Compression techniques:
- Remove redundant data (chain ID, gas price)
- Use signature aggregation
- Batch multiple transactions together
3. Optimistic Assumption
The core innovation of optimistic rollups: How it works:- Sequencer posts state root to L1 (claims “this is the new state”)
- Optimistic period begins (7 days)
- Verifiers check if state root is correct
- If correct: No action, state becomes final after 7 days
- If incorrect: Verifier submits fraud proof, invalid state reverted
🔄 Transaction Lifecycle in Detail
Complete Flow
User Submits Transaction
User sends transaction to TeQoin RPCWhat happens:
- Transaction sent to sequencer’s mempool
- User receives transaction hash instantly
Sequencer Execution (5 seconds)
Sequencer includes TX in next L2 blockUser sees: Transaction confirmed! (soft finality)
Batching (~10 minutes)
Sequencer batches many transactions togetherBatch contains:
- Compressed transaction data
- Previous state root
- New state root
- Batch metadata
Post to L1 (~10 minutes)
Batch posted to Ethereum L1L1 transaction contains:
- All L2 transaction data (compressed)
- State root commitment
Challenge Period (7 days)
Anyone can verify and challengeIf fraud detected:
- Verifier submits proof to L1
- L1 contract verifies proof
- Invalid state reverted
- Challenger rewarded, sequencer penalized
🧮 State Management
State Roots
What is a state root? A cryptographic hash (Merkle root) representing the entire L2 state:- All account balances
- All contract storage
- All account nonces
State Transition
Example:🛡️ Security Through Fraud Proofs
How Fraud Proofs Work
- Normal Case (No Fraud)
- Fraud Detected
- Fraud Proof Construction
99.99% of the time:Result: Efficient operation, no extra cost
💰 Economic Security
Incentive Structure
Why Sequencer Stays Honest
Why Sequencer Stays Honest
Economic incentives keep sequencer honest:If honest:
- ✅ Earns fees from L2 transactions
- ✅ Maintains reputation
- ✅ Keeps sequencer position
- ✅ Builds long-term value
- ❌ Loses staked collateral (slashed)
- ❌ Loses sequencer position
- ❌ Loses all future fee revenue
- ❌ Damages reputation permanently
Why Verifiers Monitor
Why Verifiers Monitor
Verifiers are incentivized to watch for fraud:Rewards:Result: Multiple independent verifiers monitor continuously
- 🏆 Fraud proof reward (e.g., 1% of slashed stake)
- 💰 Can be significant ($100K+)
- 💻 Running a verifier node (~$100/month)
- ⚡ Computing fraud proofs (minimal)
Nash Equilibrium
Nash Equilibrium
Game theory analysis:Players:
- Sequencer (wants to maximize profit)
- Verifiers (want to catch fraud for rewards)
- Users (want security)
- Sequencer stays honest (rational choice)
- Verifiers monitor actively (profitable)
- Users trust system (security guaranteed)
- No player can improve by deviating
- Fraud is always caught and punished
- Honest behavior is most profitable
📊 Performance Analysis
Scalability Breakdown
How optimistic rollups achieve 100x+ scalability:| Factor | Improvement | How |
|---|---|---|
| Off-chain Execution | 100x | Only sequencer executes, not all L1 validators |
| Batch Compression | 15x | Compress transaction data before posting |
| Calldata vs Storage | 10x | Use cheap calldata instead of expensive storage |
| No Proving Overhead | N/A | No ZK proofs needed (unlike ZK rollups) |
Gas Cost Comparison
Example: Simple ETH transfer🆚 Optimistic vs ZK Rollups
Key Differences
| Aspect | Optimistic Rollups | ZK Rollups |
|---|---|---|
| Validity Assumption | Assume valid (optimistic) | Prove valid (cryptographic) |
| Proof Type | Fraud proofs (if needed) | Validity proofs (always) |
| Withdrawal Time | 7 days | Hours |
| Proof Generation | Light (only for fraud) | Heavy (every batch) |
| EVM Compatibility | 100% (easy) | Harder (some limitations) |
| Proving Cost | Very low | High |
| Technology Maturity | Battle-tested | Newer, evolving |
When to Choose Optimistic
Optimistic rollups are better for: ✅ Full EVM compatibility needed✅ Lower operational costs preferred
✅ 7-day withdrawal acceptable
✅ Proven, mature technology wanted ZK rollups are better for: ✅ Fast withdrawals critical
✅ Higher proving costs acceptable
✅ Some EVM limitations OK
✅ Cutting-edge tech preferred TeQoin chose optimistic because:
- Full EVM compatibility = zero migration effort
- Lower costs = more sustainable long-term
- 7 days = acceptable for security trade-off
- Proven tech = less risk
🔬 Advanced Topics
Multi-Round Interactive Fraud Proofs
Multi-Round Interactive Fraud Proofs
More efficient fraud proof system:Instead of re-executing entire batch on L1:Benefits:
- Minimal L1 gas cost
- Fast resolution
- Scalable to large batches
- Takes multiple rounds (hours)
- More complex implementation
Data Availability Sampling
Data Availability Sampling
Future enhancement for even more scale:Current: All data posted to L1 calldataFuture: Data availability sampling (DAS)
- Only sample of data posted to L1
- Full data available on separate DA layer
- Can be verified through random sampling
- 10-100x more data capacity
- Even lower L1 costs
- Higher throughput
- Slightly weaker data availability guarantee
- More complex verification
Parallel Transaction Execution
Parallel Transaction Execution
Optimizing execution further:Current: Sequential executionFuture: Parallel execution
- Identify independent transactions
- Execute multiple TXs simultaneously
- Merge results deterministically
- Higher throughput (2-10x)
- Better hardware utilization
- Lower latency
- Dependency detection
- State conflict resolution
- Maintaining determinism
📚 Further Reading
Fraud Proofs
Deep dive into fraud proof system
Security Model
Complete security analysis
Sequencer Design
How block production works
Challenge Period
Why withdrawals take 7 days
External Resources
- Optimism Specs: https://github.com/ethereum-optimism/optimistic-specs
- Arbitrum Docs: https://developer.arbitrum.io/
- Vitalik’s Rollup Guide: https://vitalik.ca/general/2021/01/05/rollup.html
Understand optimistic rollups? Continue to Fraud Proofs →