Skip to main content
A deep dive into how TeQoin uses optimistic rollup technology to achieve high throughput, low fees, and Ethereum-grade security.
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:
  1. Executes transactions off-chain (on L2) for speed and low cost
  2. Posts transaction data to L1 for security and data availability
  3. Assumes transactions are valid by default (optimistic)
  4. Allows fraud proofs to challenge invalid state transitions

Key Insight


🏗️ Core Concepts

1. Off-Chain Execution

Ethereum L1 is expensive because:Every transaction must be:
  • Executed by all validators (~1 million nodes)
  • Verified by all nodes
  • Stored permanently on-chain
Cost: Each transaction uses gas from 15-30 validatorsThroughput: Limited to ~15-30 TPS

2. Data Availability on L1

1

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
Why this matters:
  • Anyone can reconstruct L2 state from L1 data
  • Data cannot be hidden or censored
  • If sequencer disappears, users can recover
2

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
Result: ~12 bytes per transaction (vs 180 bytes if posted individually)
3

Posted as Calldata

Data posted to L1 contract calldata (not storage)Why calldata:
  • Much cheaper than storage (~16 gas/byte vs 20,000 gas/slot)
  • Still permanently available on L1
  • Can be retrieved by anyone
Cost savings: ~10x cheaper than using storage

3. Optimistic Assumption

The core innovation of optimistic rollups: How it works:
  1. Sequencer posts state root to L1 (claims “this is the new state”)
  2. Optimistic period begins (7 days)
  3. Verifiers check if state root is correct
  4. If correct: No action, state becomes final after 7 days
  5. If incorrect: Verifier submits fraud proof, invalid state reverted

🔄 Transaction Lifecycle in Detail

Complete Flow

1

User Submits Transaction

User sends transaction to TeQoin RPC
What happens:
  • Transaction sent to sequencer’s mempool
  • User receives transaction hash instantly
2

Sequencer Execution (5 seconds)

Sequencer includes TX in next L2 block
User sees: Transaction confirmed! (soft finality)
3

Batching (~10 minutes)

Sequencer batches many transactions together
Batch contains:
  • Compressed transaction data
  • Previous state root
  • New state root
  • Batch metadata
4

Post to L1 (~10 minutes)

Batch posted to Ethereum L1
L1 transaction contains:
  • All L2 transaction data (compressed)
  • State root commitment
5

Challenge Period (7 days)

Anyone can verify and challenge
If fraud detected:
  • Verifier submits proof to L1
  • L1 contract verifies proof
  • Invalid state reverted
  • Challenger rewarded, sequencer penalized
6

Finalization (After 7 days)

State becomes final

🧮 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

99.99% of the time:
Result: Efficient operation, no extra cost

💰 Economic Security

Incentive Structure

Economic incentives keep sequencer honest:If honest:
  • ✅ Earns fees from L2 transactions
  • ✅ Maintains reputation
  • ✅ Keeps sequencer position
  • ✅ Builds long-term value
If dishonest:
  • ❌ Loses staked collateral (slashed)
  • ❌ Loses sequencer position
  • ❌ Loses all future fee revenue
  • ❌ Damages reputation permanently
Calculation:
Verifiers are incentivized to watch for fraud:Rewards:
  • 🏆 Fraud proof reward (e.g., 1% of slashed stake)
  • 💰 Can be significant ($100K+)
Costs:
  • 💻 Running a verifier node (~$100/month)
  • ⚡ Computing fraud proofs (minimal)
Break-even:
Result: Multiple independent verifiers monitor continuously
Game theory analysis:Players:
  • Sequencer (wants to maximize profit)
  • Verifiers (want to catch fraud for rewards)
  • Users (want security)
Equilibrium:
  • Sequencer stays honest (rational choice)
  • Verifiers monitor actively (profitable)
  • Users trust system (security guaranteed)
This is a stable equilibrium because:
  • 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: Combined effect:

Gas Cost Comparison

Example: Simple ETH transfer

🆚 Optimistic vs ZK Rollups

Key Differences

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

More efficient fraud proof system:Instead of re-executing entire batch on L1:
Benefits:
  • Minimal L1 gas cost
  • Fast resolution
  • Scalable to large batches
Drawback:
  • Takes multiple rounds (hours)
  • More complex implementation
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
Potential improvements:
  • 10-100x more data capacity
  • Even lower L1 costs
  • Higher throughput
Trade-off:
  • Slightly weaker data availability guarantee
  • More complex verification
Optimizing execution further:Current: Sequential executionFuture: Parallel execution
  • Identify independent transactions
  • Execute multiple TXs simultaneously
  • Merge results deterministically
Benefits:
  • Higher throughput (2-10x)
  • Better hardware utilization
  • Lower latency
Challenges:
  • 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


Understand optimistic rollups? Continue to Fraud Proofs