Skip to main content

OP Stack

Key Takeaways

  • OP Stack is an open-source, modular methodology for constructing optimistic rollups.
  • The state processing phase involves two main components: op-geth and op-proposer.
  • Transactions and output state roots are stored as calldata in L1 to ensure data availability.
  • The OP Stack team is exploring the concept of a network of chains called the Superchain.

1. Overview


OP-Stack is an open-source, modular methodology designed for constructing optimistic rollups. The initial mainnet release of OP-Stack was the Bedrock upgrade on Optimism on June 6, 2023. This significant upgrade to the Optimism network lowered transaction fees, boosted security, and provided more customizability.

2. Execution


The state processing phase involves two main steps. First, transactions are applied to the current state, generating a new state. Second, a new Merkle root is suggested to represent the state. This process is carried out by two components: op-geth and op-proposer.

In the first step, op-geth modifies the current state by applying transactions. . During this process, a single sequencer receives transactions, which are then executed by op-geth and modify the state. The transaction is managed by an EVM state machine minimally modified from Ethereum's state machine.

Lastly, op-proposer plays a crucial role in finalizing state transitions. After op-geth modifies the state, op-proposer writes a commitment to the post-transaction state to L1. This records the updated state and proposes the new Merkle root of the updated state. To minimize the data written to L1 and reduce transaction costs, Merkle roots are used. These state root proposals are posted to the L2OutputOracle on the L1 network. These output proposals must undergo a 7-day fault challenge period before gaining authority. This facilitates potential disputes and challenges, enhancing network reliability and accountability.

3. Settlement


The Settlement Layer is a mechanism on external blockchains that establish a view of the state of an OP Stack chain on those external chains (including other OP Stack chains). For each OP Stack chain, there may be one or more Settlement mechanisms on one or more external chains. Settlement Layer mechanisms are read-only and allow parties external to the blockchain to make decisions based on the state of an OP Stack chain.

The term “Settlement Layer” has its origins in the fact that Settlement Layer mechanisms are often used to handle withdrawals of assets out of a blockchain. This sort of withdrawal system first involves proving the state of the target blockchain to some third-party chain and then processing a withdrawal based on that state. However, the Settlement Layer is not strictly (or even predominantly) financial and, at its core, simply allows a third-party chain to become aware of the state of the target chain.

Once a transaction is published and finalized on the corresponding Data Availability layer, the transaction is also finalized on the OP Stack chain. Short of breaking the underlying Data Availability layer, it can no longer be modified or removed. It may not be accepted by the Settlement Layer yet because the Settlement Layer needs to be able to verify transaction results, but the transaction itself is already immutable.

3.1 New Proof System

OP Stack is a development stack that is standardized, shared, and open-source, used to power Optimism and maintained by the Optimism Collective. It is a modular source code that is highly extensible, and goes beyond being just a rollup or an optimistic solution. The set of solutions shared by Optimism provides a foundation for a development roadmap to Modular Blockchain.

The Fault Proof System is an essential component of the OP Stack that includes the error-proof Program (FPP), the fault-proof virtual machine (FPVM), the Dispute Game, and other components of the fault-proof system. This system demonstrates the powerful modularity of the OP stack and is an important step toward a more efficient and decentralized Superchain. The developers of the Optimism ecosystem are currently working on improving the Fault Proof System.

Fraud proofs are a validation mechanism used in the Optimistic Rollup solution. During the process of synchronizing Layer 2 data to the Ethereum mainnet, if someone believes that the synchronized data is incorrect due to fraudulent behavior, they can issue a challenge during the challenge period. The challenge is then resolved through Layer 1 smart contract calculations to determine the fraudulent party and impose penalties. Developers are currently working on the Fraud Proof System for the OP Stack, which includes components such as the FPP, FPVM, and Dispute Game.

Additionally, applying zk proof to OP-Stack is currently under development and testing.

4. Data Availability


To ensure data availability, transactions, and output state roots are stored in L1 as calldata, enabling the reproducibility of L2 state.

4.1 Posting Transactions to L1

To write the transaction to L1, two sub-steps are required: compression and posting to L1. During compression, op-batcher divides sequencer batches into channels to maximize compression ratio. Channels are compressed and transcribed once they are filled or timed out.

Once compression is complete, the transaction is posted to L1. When a channel is saturated, it is dispatched to L1 as either a single or multiple transactions, depending on the data size. An L2 transaction can be in one of three states: unsafe (processed but not yet written to L1), safe (processed and written to L1, but might be discarded due to an L1 reorganization), and finalized (written to L1 in an adequately mature block). Once a transaction reaches the 'finalized' state, it cannot be undone.

4.2 Proposing State Root

In the next step, op-proposer proposes the new Merkle root of the state and stores the root to an L2OutputOracle contract in L1. Instead of transcribing the entire state to L1 directly, which would be resource-intensive due to its large size, a Merkle root is used as a compact representation. This root encapsulates critical information about the state alterations and enables effective verification.

5. Interoperability


The OP Stack is exploring the concept of a network of chains called the Superchain, which would share decentralized governance, upgrades, and a communication layer.

This would enable atomic cross-chain interactions through synchronous cross-chain messaging, using a shared sequencing protocol on both chains. For example, if a user wants to execute a cross-chain arbitrage transaction, users would submit the transaction to the sequencers on both chains, who would come to consensus on when to include it and then atomically include each transaction in the linked block. This enables complex transactions such as cross-chain flash loans and even allows individual smart contracts to be executed across chains.

However, this is currently a conceptual idea and does not have specific specifications.

6. Use Cases


6.1 OP-Mainnet (prev. Optimism)

OP-Mainnet is based on the OP-Stack. Actually, OP-Mainnet is OP-Stack and OP-Stack is OP-Mainnet. The first version of OP-Stack was released during a major upgrade of OP-Mainnet called Bedrock. OPLabs, the team behind OP-Mainnet, is currently leading the development of the OP-Stack and is focused on improving the proof system. This involves implementing a decentralized and efficient fault-proof system, as well as integrating zk proof into the OP-Stack.

6.2 Base by Coinbase

Base is a new L2 on Ethereum and developed by Coinbase. It serves as a Layer 2 (L2) network, providing a secure, low-cost, and developer-friendly way to build decentralized applications (dapps). OP Stack is the foundation of Base. It is being incubated within Coinbase and will gradually decentralize over the next few years.

One of the benefits of working with Base is that developers will have access to Coinbase's large user base of non-DeFi natives. The technology powering Base is based on the "superchain" idea, where Optimism provides the tech stack for other potentially permissioned blockchains to build and be secured by Optimism.

6.3 OP-Clave

https://ethglobal.com/showcase/opclave-opstack-impr-erc4337-and-apple-sign-94def

Ethereum supports Elliptic Curve Digital Signature Algorithm (ECDSA) on the elliptic curve secp256k1. However, this necessitates that the verification of other elliptic curves be processed through a newly deployed smart contract, consequently leading to a substantial verification cost. This is an inherent challenge considering the broad potential applications and benefits that diverse elliptic curves can offer.

In response to this issue, OP-Clave has been introduced. It is a custom rollup that incorporates a “secp256r1 verifier” as a precompiled contract, conforming to the standards of Optimism’s Bedrock Release. This integration has paved the way for an environment where Face-ID and Touch-ID verified transactions could be applied. The OP-Clave’s unique approach optimizes efficiency and affordability while ensuring secure and reliable transactions.

6.4 Zora Network

Introduction | Zora Docs

6.5 Celo

cLabs Proposal for Celo to transition to an Ethereum L2 - Protocol - Celo Forum

6.6 opBNB

opBNB: High-Performance Optimistic Layer 2 Solution for BNB Smart Chain

6.7 OP-Craft by Lattice

https://blog.oplabs.co/opcraft-autonomous-world/

OPCraft is a fully on-chain virtual world that runs on an op-chain, meaning every aspect of the world exists on-chain and every action in the world happens as an Ethereum transaction. Players can explore procedurally generated landscapes, mine ores, place materials, and craft new items, either alone or collaboratively. The network runs on OP Mainnet's OP Stack architecture, with simple adjustments made for higher throughput and shorter block times. Developers can deploy smart contracts on this chain and anyone can run a node to access it.

7. Team


8. Resources


CTRL + J