Understanding Ethereum Layer 2s and the Optimism Ecosystem
Module 1: What Are Ethereum Layer-2s?
Ethereum is the most widely used smart contract platform in the world. It allows developers to build decentralized applications (dApps) that are secure, censorship-resistant, and trustless—all running on a global computer that anyone can access.
But as powerful as Ethereum is, it has a well-known problem: it doesn’t scale.
When the network gets busy, transactions slow down. Gas fees, the cost to use Ethereum, can jump from a few cents to $50 or more. Apps become unusable, and users get frustrated. This isn’t a minor issue; it's the single biggest challenge facing Ethereum today and has been holding back its mainstream adoption for years.
That’s where Layer-2 scaling solutions come in.
What is a Layer-2?
A Layer-2, or L2 for short, is a blockchain that runs on top of Ethereum. It’s not a competitor; it’s a collaborator. A Layer-2 processes transactions separately from Ethereum and then submits the results back to Ethereum for final settlement. This means you get faster and cheaper transactions but still inherit Ethereum’s security.
Think of Ethereum as the final judge in a legal system. L2s handle the day-to-day cases and only go to Ethereum when something needs final verification.
Why Does Ethereum Need L2s?
To understand why L2s are necessary, you need to understand the scalability trilemma. This is a concept introduced by Vitalik Buterin that says a blockchain can’t have full scalability, security, and decentralization all at once. You can optimize for two, but not all three.
Ethereum has optimized for security and decentralization. It does this by keeping block sizes small and requiring every full node to verify every transaction. That's great for trust and security, but it means Ethereum can only handle around 15 transactions per second (TPS). Compare that to Visa, which handles thousands of TPS. When Ethereum demand increases, the only way to keep things moving is to raise gas prices—which means higher costs for everyone.
Layer-2s solve this by moving transaction execution off the main Ethereum chain while keeping settlement and security on-chain.
How Layer-2s Work (At a High Level)
At a technical level, a Layer-2 takes a batch of transactions, executes them off-chain (away from Ethereum), and then publishes a summary of those transactions back to Ethereum. This process is called a rollup.
There are two major types of rollups:
-
Optimistic Rollups Optimistic Rollups assume transactions are valid by default. But just in case something goes wrong, they offer a challenge window (usually 7 days) during which anyone can submit proof of fraud. If fraud is found, the invalid transaction is rolled back, and the malicious actor is penalized. Why “optimistic”? Because the system is “optimistic” that no one is trying to cheat—unless proven otherwise. This design makes Optimistic Rollups simple and EVM-compatible; you can port Ethereum apps to L2 with almost no changes. Examples: Optimism, Base (by Coinbase), Boba Network
-
ZK Rollups (Zero-Knowledge) ZK Rollups use cryptographic proofs—specifically zero-knowledge proofs—to prove that a batch of transactions is valid. These proofs are small and efficient, and they get verified on Ethereum. There’s no challenge period. No assumptions. Just math. ZK Rollups are more secure and faster to finalize, but they’re harder to build—especially if you want them to be compatible with Ethereum’s EVM. Examples: zkSync Era, Starknet, Scroll
Rollups vs. Sidechains: What’s the Difference?
It’s common to hear people confuse L2s with sidechains. But there’s a key difference:
- Sidechains are independent blockchains. They have their own validators and consensus rules. They don’t inherit Ethereum’s security.
- Rollups rely on Ethereum for security. They settle their data on Ethereum and use Ethereum to resolve disputes. If a sidechain gets attacked, your funds can be at risk. If a rollup gets attacked, Ethereum will intervene—because that’s where the final data lives.
Bottom Line: Rollups are Layer-2s. Sidechains are not.
Why Not Just Improve Ethereum?
Why don’t we just make Ethereum itself faster? The answer is: we are—slowly, and carefully.
Ethereum’s roadmap includes upgrades like Danksharding and EIP-4844 (Proto-Danksharding), which will make it cheaper to post rollup data and improve overall capacity. But Ethereum can’t just scale by increasing block size or TPS without risking centralization. It must remain verifiable—anyone in the world should be able to run a node.
Layer-2s let Ethereum grow without compromising its core values. They take the load off the base layer. They act as force multipliers. They allow Ethereum to serve millions of users while remaining decentralized and secure.
Module 2: What is Optimism?
The Big Picture
Ethereum is powerful—but slow and expensive. We’ve already explored how Layer-2s are here to help. They move execution off-chain while keeping Ethereum as the final settlement layer. They’re fast, cheap, and secure—the best of all worlds.
But not all Layer-2s are the same.
Optimism isn’t just an L2. It’s a platform, a movement, and a vision for a new kind of internet economy. It’s one of the most mature, production-ready L2s built on Ethereum today, with real users, real volume, and a growing ecosystem.
Optimism in one sentence: Optimism is an Ethereum Layer-2 built using optimistic rollups, designed to make transactions faster, cheaper, and just as secure as the Ethereum mainnet.
Why Optimism Exists
Ethereum is secure and decentralized, but it comes at a cost: scalability.
Optimism is designed to reduce the cost—literally. On Ethereum, a single token swap might cost $15. On Optimism, that same swap could cost $0.50—or even less.
But Optimism isn’t only about lower fees. It’s about:
- Keeping full compatibility with Ethereum.
- Providing a great developer experience.
- Creating a sustainable ecosystem that rewards contributors.
Let’s explore each of these pillars.
How Optimism Works
Optimism is a rollup—more specifically, an optimistic rollup. That means it batches up many transactions, executes them off-chain, and posts the results back to Ethereum. It assumes transactions are valid unless challenged.
Here’s a simplified flow:
- You send a transaction on Optimism.
- A special node called the Sequencer picks it up and includes it in an L2 block.
- That block’s data is batched and posted to Ethereum.
- There’s a 7-day window for anyone to challenge that batch if it’s incorrect.
- If no one challenges it, the data becomes final on Ethereum.
This design makes rollups like Optimism faster and cheaper while still leveraging Ethereum’s security.
EVM Equivalence
One of Optimism’s biggest strengths is EVM equivalence. Most Layer-2s aim for “EVM compatibility”—which means they can run Ethereum smart contracts but might need some adjustments.
Optimism goes further. It aims to behave exactly like Ethereum. If it runs on Ethereum, it should run on Optimism—no changes needed. This makes life easier for developers:
- Same tooling (Remix, Hardhat, Foundry)
- Same languages (Solidity, Vyper)
- Same wallets (MetaMask, Coinbase)
You can deploy to Optimism like you would on Ethereum—just faster and cheaper.
The OP Token
Optimism also has a native token: OP.
This isn’t just for speculation—it plays a critical role in governance. Holders of OP help govern:
- Protocol upgrades
- Ecosystem funding decisions
- The long-term vision of the Optimism Collective
OP is used to vote, propose changes, and decide how to allocate public goods funding (more on that soon). It’s not yet used for paying gas (transactions still use ETH), but that could change as the system evolves.
The Optimism Collective
This is where things get truly unique. Optimism isn’t just trying to scale Ethereum; it’s trying to fund the future of the internet.
The Optimism Collective is a group of developers, creators, builders, and citizens all working together to support public goods—things that benefit everyone but aren’t easy to monetize. Examples of public goods include open-source software, educational content, developer tools, and research.
The Collective runs a program called RetroPGF (Retroactive Public Goods Funding), where it retroactively rewards people who have made meaningful contributions to the ecosystem—even if they weren’t paid upfront. This creates a new kind of incentive system: do good for the community now and get rewarded later—based on impact, not hype. This is a radical shift from the “build for VC returns” model we see in traditional tech.
What can you do on Optimism?
Just about everything you can do on Ethereum.
- Use DeFi platforms (Uniswap, Aave, Synthetix)
- Mint, buy, and sell NFTs
- Create DAOs
- Play Web3 games
- Launch your own tokens and dApps
And all of it comes with faster confirmations and lower gas costs. Optimism is designed to feel like Ethereum—just smoother.
Module 3: The OP Stack—The Backbone of the Superchain
What is the OP Stack?
The OP Stack is the modular, open-source software that powers Optimism. But it’s more than that. It’s the standardized framework for building Layer-2 blockchains—not just Optimism itself, but many other L2s like Base (by Coinbase), Zora Network, Mode, and others.
If Optimism is the product, the OP Stack is the toolkit behind it. And it’s designed for one ambitious purpose: to create an interconnected network of Layer-2 chains that all work together—the Superchain.
Why the OP Stack Exists
Building an L2 from scratch is hard. You have to build your own execution engine, consensus system, data availability layers, bridges, governance tools, monitoring systems, infrastructure, and much more. Every project ends up reinventing the wheel—wasting time and resources.
The OP Stack solves this by providing a shared, production-ready framework. It’s modular. It’s standardized. And it’s open to anyone. Whether you’re Coinbase or a solo founder, you can use the OP Stack to launch your own Ethereum-secured chain.
Key Design Philosophy
The OP Stack is built around 4 core values:
- Simplicity: Keep the design minimal. Reuse Ethereum where possible. Less code = fewer bugs.
- Pragmatism: Focus on what works. Ship early. Iterate. Solve real problems, not theoretical ones.
- Sustainability: Make sure the ecosystem can grow and be maintained by many contributors over time.
- Optimism: Believe in Ethereum’s vision. Build to support it. Stay aligned with the values of public goods and open infrastructure.
Layers of the OP Stack
The OP Stack isn’t a monolith. It’s a stack of layers, each responsible for a specific part of the system.
- Execution Layer: Runs your smart contracts, just like Ethereum. It uses a customized version of Geth, called
op-geth, which behaves nearly identically to Ethereum’s mainnet client. - Consensus Layer: Ensures all nodes agree on the order of transactions. Handled by a component called
op-node, which watches over L2 blocks and interacts with L1 to submit and verify data. - Data Availability (DA) Layer: Posts L2 data to Ethereum. This is what makes Optimism secure—all transaction data is available and verifiable on L1.
- Governance Layer: Handles upgrades, funding, permissions, and consensus rules. Uses the OP token and the Optimism Collective to guide decisions.
- Interoperability & Messaging: This is the Superchain glue. Future modules will allow seamless communication between different OP Stack chains.
Bedrock: The Current OP Stack Release
The current version of the OP Stack is called Bedrock. It was a massive overhaul designed to be:
- Fully EVM-equivalent
- Improve modularity
- Enable Superchain compatibility
- Reduce L1 data costs
Bedrock restructured Optimism to look and behave almost exactly like Ethereum—down to its block structure and execution logic. This means you can use all Ethereum tooling, auditing and security become easier, and compatibility with other L2s becomes seamless.
What Makes the OP Stack Powerful?
Let’s break down what the OP Stack actually gives you as a builder:
- A Geth-based EVM execution engine
- A rollup node that tracks L1 and L2
- A batcher that posts L2 data to Ethereum
- A proposer that submits state roots to Ethereum
- Monitoring, snapshotting, and RPC infra
- Full Superchain compatibility
- MIT license—fully open source
Instead of building all this yourself, you use the OP Stack and get a working chain out of the box.
The Superchain Vision
This is where things get bold. The OP Stack isn’t just about running one chain—it’s about enabling many chains to run in parallel, using the same architecture and standards. This is the idea behind the Superchain.
A network of OP Stack chains that share security, tooling, governance, and messaging. Think of it as Ethereum’s own Layer-2 ecosystem—but unified. This unlocks massive scalability, specialized app-chains, faster innovation, and an actual onchain internet.
Notable Projects Using the OP Stack
Here are a few real-world chains already using or forking the OP Stack:
- Base: Coinbase’s Layer-2, built for mass adoption.
- Zora: An NFT-centric chain for creators and artists.
- PGN: Public Goods Network, which funds open infrastructure.
- Mode: An Optimism fork focused on growth sharing.
Each of these chains is unique, but they all speak the same language: the OP Stack.
Module 4: The Architecture of an OP Stack Chain
The Core Components
Let’s start with the essential services every OP Stack chain needs:
| Component | Purpose |
|---|---|
op-geth | Executes transactions (Execution Layer) |
op-node | Maintains consensus (Consensus layer) |
op-batcher | Sends L2 data to Ethereum |
op-proposer | Posts output roots to Ethereum |
op-deployer | Deploys new chains |
Let’s explore each one in detail.
-
op-geth: The Execution Engine This is a fork of Geth—Ethereum’s most popular execution client. It’s the part of the OP Stack that executes smart contracts, maintains the state of the chain, and handles gas metering, logs, storage, etc. Optimism’s version is slightly modified but stays as close as possible to upstream Geth for long-term maintainability. -
op-node: The Consensus Engine This component ties everything together. It follows Ethereum L1 blocks, receives blocks from the sequencer, and validates and reassembles L2 chains.op-nodeis the brain that watches L1 and keeps the L2 chain in sync. It’s also responsible for computing output roots—a cryptographic hash of the entire L2 state at a certain block height—which are then posted to Ethereum viaop-proposer. -
The Sequencer The Sequencer is a privileged node that creates blocks on the L2. It accepts transactions from users, orders them into blocks, and broadcasts those blocks to replicas. The Sequencer is fast but centralized (for now). This design enables instant transaction confirmations and excellent UX, but it's trust-minimized because all state transitions can still be challenged via Ethereum.
-
op-batcher: Posting Data to Ethereum Once L2 blocks are produced, the batcher posts their transaction data to Ethereum using calldata or blobs (EIP-4844). This ensures all L2 activity is public and verifiable. If the sequencer disappears, anyone can recreate the chain. -
op-proposer: Posting Output Roots The proposer is a small service that takes finalized L2 state snapshots, computes the output root, and submits it to Ethereum. This enables L2-to-L1 messaging and dispute resolution. Every time the proposer submits an output root, it gives Ethereum a “fingerprint” of the L2 state, allowing Ethereum to act as a judge if anything goes wrong. -
op-deployer: Chain Setup & Lifecycle This is a developer-focused tool for spinning up new OP Stack chains. It handles configuration validation, smart contract deployment, genesis file creation, and ensures compatibility with the Superchain.
Supporting Infrastructure (But Equally Important)
These components aren’t part of the “core loop,” but they’re critical to running a production-grade OP chain:
- Replica Nodes: Help offload RPC requests from the sequencer and share the mempool.
- Archive Nodes: Store the full historical state, required for challengers and state verifiers.
- Proxyd: Routes RPC traffic efficiently, handles retries, and load balancing.
- Bootnodes: Handle P2P discovery to help new nodes find peers on the network.
- Monitoring + Tooling: Such as
op-challenger(monitors for invalid state transitions) andmonitorism(a chain health dashboard).
Data Flow Overview
Let’s put it all together in one lifecycle:
- A user sends a transaction to the Sequencer.
- The Sequencer includes it in an L2 block using
op-geth. - The block is propagated to replica nodes.
- The Batcher collects block data and posts it to Ethereum (L1).
- The Proposer computes the output root and posts it to Ethereum.
- Verifiers on Ethereum can challenge the state if needed.
Module 5: Running a Chain—Deployment, Configuration & Governance
What it means to “run” a rollup
Running an OP Stack chain isn’t like deploying a smart contract. You’re not just writing Solidity and calling it a day. You’re launching a blockchain of your own—with block production, data publication, uptime responsibilities, and validator-facing interfaces. You are, effectively, a chain operator.
So what do you need?
- A correct deployment config
- Properly set up infrastructure (sequencer, batcher, proposer, nodes)
- Smart contract deployments on Ethereum L1
- A governance plan
- Data availability guarantees
- Monitoring and security systems
Let’s go through each one.
Step 1: Rollup Configuration
The Rollup Configuration JSON file is where your chain’s personality is defined. This file feeds into the deployment scripts and sets core parameters for how your chain behaves, including genesis parameters, chain ID, sequencer address, and gas configuration.
Step 2: Deploy the Chain
With your config file ready, the next step is to run op-deployer. This script handles compiling contracts, deploying them to Ethereum L1, generating your genesis file, and preparing your node configs. Once complete, you’ll have a live set of L1 contracts and your chain is ready to produce blocks.
Step 3: Batcher Configuration
The batcher takes finalized L2 blocks and posts the raw transaction data to Ethereum. You must define the batch submission frequency, data availability method (calldata vs. blobs), and throttle settings. Best practices suggest a submission window between 1 and 6 hours and using blobs if you expect high transaction volume.
Step 4: Proposer Configuration
The proposer submits the output root to L1. This root is a hash representing the full state of your L2 at a given point and is crucial for fraud proofs and L2-to-L1 communication. You can configure how often output roots are submitted and the trusted proposer address. Keep proposer uptime high and monitored, as this data is what Ethereum trusts.
Step 5: Set up Your Infrastructure
Once your chain is deployed, your infrastructure setup determines reliability and performance. A minimum production setup includes one sequencer, one batcher, one proposer, an archive node, and a replica node. High availability setups use multiple redundant components for failover. Security tips include running sequencers behind firewalls and keeping signing keys in secure management systems.
Step 6: Governance & Upgrades
An OP Stack chain is alive—and you’ll need to update it over time. This means upgrading smart contracts, changing batcher or proposer keys, and managing governance. Optimism provides standardized governance frameworks, but chains can create their own. A strong governance plan ensures trust and a clear path for future development.
Module 6: Fault Proofs, Security Models, and Decentralization
Why Fault Proofs Matter
Optimism is fast and cheap, but it doesn’t sacrifice security. That’s because Optimism is a Layer-2 rollup, and rollups are secured by Ethereum itself. The mechanism that makes this work is a powerful system called a fault proof—sometimes also called a fraud proof. This is the heart of what makes optimistic rollups secure.
Fault Proofs: The Big Idea
Optimistic rollups assume that all transactions are valid by default. This speeds things up, but there’s a catch: the system needs a way to challenge and reverse invalid transactions. Here’s what happens under the hood:
- A batch of L2 transactions is posted to Ethereum.
- There’s a challenge window (usually 7 days).
- Anyone (called a challenger) can prove that a transaction in the batch was invalid.
- If the proof succeeds, the batch is rejected, and Ethereum rolls back the state.
This mechanism makes the system trustless. Even if the sequencer is malicious, they can be caught.
The Challenge Window
The 7-day window is long enough to give challengers time to analyze the batch, allowing for off-chain data to be retrieved or reconstructed. During this period, withdrawals from Optimism to Ethereum are delayed—this is the cost of security. Once the window closes, the data is finalized, and Ethereum enforces the result.
Cannon: Optimism’s Fault Proof System
Optimism’s implementation of fault proofs is called Cannon. It’s designed to be fully trustless and modular and aligns with Ethereum’s execution model. Cannon allows for a minimal and auditable fault proof system that can prove or disprove L2 state transitions by emulating the exact EVM logic.
Enter: op-challenger
This is the component that watches everything. It observes new output roots submitted by the L2 proposer and, if an invalid root is detected, it generates a fault proof and submits it to Ethereum. This service is critical for the trustless operation of OP Chains.
Decentralizing the Sequencer
Right now, Optimism uses a centralized sequencer. That’s a conscious design decision for fast confirmations and great UX. But it’s not the endgame. The long-term plan is sequencer decentralization, which is already underway. Future designs may include rotating sequencer sets or shared sequencing networks, removing any single point of failure and making the network more resilient.
Risks and Threat Models
No system is perfect. Here are the key risks Optimism faces: MEV extraction, sequencer downtime, censorship, and rollback attacks. Optimism addresses these risks by ensuring everything is verifiable on Ethereum, allowing anyone to become a challenger, and planning a shift toward sequencer decentralization.
Module 7: Governance, the OP Token & Public Goods
What Does It Mean to Govern a Chain?
Blockchains are communities, economies, and infrastructure. At some point, decisions need to be made about protocol upgrades, funding, and the future vision. This is where governance comes in, and Optimism is leading the way with a radically new model.
The OP Token
The OP token is Optimism’s native token, but it’s not used for gas. All transactions on Optimism still use ETH. OP is the fuel for governance, giving holders the power to vote on protocol upgrades, decide where treasury funds go, and influence the future of the OP Stack. It’s a governance token, not a fee token, and it powers a new kind of collective.
The Optimism Collective
The Optimism Collective is Optimism’s onchain governance system, a two-house system inspired by real-world governance:
- Token House: Made up of OP token holders who vote on protocol upgrades and grants.
- Citizens’ House: Made up of non-transferable NFTs (called “citizenship”) that vote on retroactive public goods funding.
This structure separates economic power from community impact.
Retroactive Public Goods Funding (RetroPGF)
This is Optimism’s biggest idea. Traditional funding means you get money before you build. RetroPGF means you get rewarded after you create impact. Builders, creators, and educators contribute to the ecosystem, and the Citizens’ House evaluates the impact and retroactively rewards contributors in OP tokens. This flips the traditional VC model on its head.
What Counts as a Public Good?
In the context of Optimism, public goods are open-source tools, educational content, community events, and infrastructure that benefit the ecosystem. The goal is to make Ethereum’s base layer and the rollup ecosystem richer and more sustainable.
Module 8: Comparing Optimism to Other Layer-2s
Optimistic Rollups vs ZK Rollups
Before we dive into individual chains, it’s important to understand the two dominant L2 families:
- Optimistic Rollups: Assume transactions are valid; use fault proofs to catch fraud if challenged.
- ZK Rollups: Prove each transaction is valid with zero-knowledge proofs upfront. Optimism and Arbitrum use the optimistic model. zkSync, Starknet, and Scroll are building on ZK rollups.
Arbitrum vs. Optimism
| Feature | Optimism | Arbitrum |
|---|---|---|
| Tech Stack | OP Stack (modular, EVM-equivalent) | Nitro (custom VM, optimized WASM) |
| Governance | Optimism Collective (2-house DAO) | Arbitrum DAO (token holder-based) |
| Public Goods Funding | Yes (RetroPGF + grants) | Limited grant program |
| Codebase Licensing | MIT (fully open source) | Business Source License (not fully open) |
| EVM Equivalence | True equivalence | High compatibility, not exact |
| Superchain Vision | Yes | Not Defined |
Starknet vs. Optimism
| Feature | Optimism | Starknet |
|---|---|---|
| Tech Stack | OP Stack (EVM-native) | Cairo-based ZK-STARK rollup |
| EVM Equivalence | Full equivalence | No EVM support (Cairo only) |
| Developer Experience | Plug-and-play with Ethereum | Requires learning Cairo, custom tooling |
Scroll vs. Optimism
| Feature | Optimism | Scroll |
|---|---|---|
| Tech Stack | OP Stack (modular, open source) | zkEVM (close to Ethereum spec) |
| EVM Equivalence | True equivalence | Near-complete equivalence (some pending features) |
| Dev Tooling | Fully compatible with Ethereum tools | Close, but not yet as stable or battle-tested |
Why Build on Optimism?
If you want familiar tools (Solidity, Hardhat, Foundry), fast finality and low fees, real users and real volume, a modular stack to launch your own chain, open governance, and a future in the Superchain, then Optimism is your home. It’s not just an L2; it’s a platform, a collective, and a movement.