OP Stack Explained

Zeynep Miraç Yıldırım
10 min readJul 29, 2023

--

What Is OP Stack?

The OP Stack represents an established and open-source development framework utilized by Optimism, a project maintained by the Optimism Collective. This standardized stack serves as a public resource for both the Ethereum and Optimism ecosystems. Its primary function is to power Optimism by providing a set of software components, currently utilized in Optimism Mainnet, and eventually, in the Optimism Superchain and its governance. The vision behind the OP Stack is to encourage innovation within the Ethereum community. By offering a user-friendly platform, developers can focus on cutting-edge advancements, simplifying the process of creating their own blockchains.

The OP Stack operates on the belief that the future will not be dominated by either multi-chain or mono-chain systems. Instead, an integrated network of chains, termed the Superchain, will emerge to empower the collective ecosystem. The OP Stack consists of various software components that define different layers of the Optimism ecosystem. These components can either establish specific layers or serve as modules within existing ones.

While currently centered around infrastructure for L2 blockchains, the OP Stack has the potential to extend to other layers, including block explorers, messaging mechanisms, governance systems, and more. Optimism Bedrock, the latest iteration of the OP Stack, enables the deployment of production-quality Optimistic Rollup blockchains. The APIs for each layer within the OP Stack are closely linked to this Rollup configuration, allowing for seamless integration and modification of modules to suit specific application requirements.

One of the core aspects of the OP Stack is its modular blockchain theory, which future-proofs the ecosystem. The stack abstracts the proof layer when settling funds onto another chain. As long as the proof layer satisfies the proof API, it can be seamlessly incorporated into the system without affecting the user experience. This adaptability opens up possibilities for Optimism to accommodate newer proof systems in the long run.

If you’re enthusiastic about becoming a part of the Superchain project, you can begin your journey by creating your initial Superchain-compatible L2 using their comprehensive Getting Started tutorial.

“Three Key Design Principles”

The OP Stack is a compilation of software components specifically designed for constructing L2 blockchain ecosystems, expertly crafted by the Optimism Collective to empower the Optimism platform. When integrating components into the OP Stack, adherence to three fundamental design principles is crucial: Utility, Simplicity, and Extensibility. Software that aligns with these principles is considered to be of paramount importance, providing optimal usefulness to the Optimism Collective.

Utility

To be eligible for inclusion in the OP Stack, any software must actively contribute to empowering the Optimism Collective. This requirement serves as a guiding principle for determining the suitability of components for the stack. For example, a robust open-source block explorer that facilitates user inspection of the Superchain would be a valuable and welcome addition to the OP Stack.

While utility remains a key consideration for OP Stack inclusion, it is equally important to embrace experimentation and creativity. There’s room for audacious ideas and unconventional projects. Don’t hesitate to venture into uncharted territories and develop something innovative that has never been attempted before, even if its immediate utility isn’t apparent. The overarching philosophy is to have an enjoyable and stimulating journey while fostering a thriving ecosystem within the Optimism Collective.

Simplicity

Incorporating complex code into the OP Stack is avoided, as simplicity is favored. By prioritizing simplicity, the Optimism Collective minimizes engineering overhead, allowing more time and effort to be devoted to developing new features instead of duplicating existing ones. Utilizing battle-tested code and infrastructure whenever possible is an essential aspect of this approach, as demonstrated by the preference for Geth as the OP Stack’s default execution engine.

Simplicity is a key factor in enhancing security and maintainability, especially when dealing with critical infrastructure. Every line of code introduces the potential for bugs and vulnerabilities, so a straightforward protocol with less code reduces the surface area for potential mistakes. Moreover, a clean and minimal codebase fosters greater accessibility for external contributors and auditors, ensuring the utmost security and accuracy for the OP Stack.

Extensibility

The strength of good OP Stack code lies in its inherent openness, collaboration, and extensibility. Emphasizing collaboration enables us to break free from isolated development approaches. Through collaborative efforts, we can invest more time in building upon each other’s work and less time reinventing the same components repeatedly. Collaboration is the key to our collective success.

Extensible code is crafted with the foresight that others will want to build and expand upon it. In practice, this means adhering to open-source principles with permissive licensing, offering clean and accessible APIs, and ensuring modularity to enable other developers to easily extend the code’s functionality. Extensibility serves as a fundamental design principle that empowers collaboration within the Optimism Collective ecosystem, unleashing its full potential.

OP Stack Layers

Data Availability

The Data Availability Layer plays a crucial role in determining the publication location of raw inputs for an OP Stack-based chain. A chain built on the OP Stack can employ one or multiple Data Availability modules to access its input data. As the OP Stack chain relies on the Data Availability Layer, the choice of Data Availability module(s) has a substantial influence on the security model of the system.

The impact of the selected Data Availability module(s) becomes evident in the system’s security and synchronization capabilities. If, for instance, a specific piece of data becomes inaccessible from the Data Availability Layer, it could hinder the chain’s synchronization process. This highlights the critical importance of making informed decisions regarding the Data Availability Layer to ensure the overall robustness and security of the OP Stack-based chain.

Ethereum DA

As of now, the Ethereum Data Availability (DA) module stands as the most extensively utilized option for the OP Stack. By employing the Ethereum DA module, source data for the OP Stack can be obtained from various pieces of information accessible on the Ethereum blockchain. This encompasses Ethereum calldata, events, as well as 4844 data blobs, providing a versatile and comprehensive range of data sources to support the OP Stack’s functionalities. The popularity of the Ethereum DA module reflects its effectiveness and compatibility within the Optimism ecosystem.

Spesifications and Source Code is here.

Sequencing

The Sequencing Layer plays a vital role in managing the collection and publication of user transactions within an OP Stack chain, specifically to the Data Availability Layer module(s) in use. In the default Rollup configuration of the OP Stack, the Sequencing responsibility is usually assigned to a dedicated Sequencer entity.

To ensure fairness and efficiency, rules outlined in the Derivation Layer impose restrictions on the Sequencer’s authority, limiting their ability to withhold transactions beyond a specified time frame. This ensures that transactions are promptly processed and integrated into the chain.

In the proposed future development, the Sequencing Layer is designed to be modular, allowing chains the flexibility to choose and change the mechanism governing their current Sequencer. This modular approach will enable chains to easily switch and adopt different Sequencing mechanisms, tailoring their setup according to evolving requirements and preferences. The emphasis on modularity empowers chains to adapt and optimize their Sequencing process, ensuring continued efficiency and adaptability within the OP Stack ecosystem.

Single Sequencer

The default Sequencer module for the OP Stack is the Single Sequencer. Here, a dedicated actor is granted the privilege to act as the Sequencer. This module operates with a governance mechanism that transparently selects the Sequencer, ensuring a secure and well-regulated system. The community or designated authorities have the authority to make informed decisions about who assumes this critical role, ensuring efficient transaction processing within the OP Stack ecosystem.

Multiple Sequencer

A straightforward alteration to the Single Sequencer module is the Multiple Sequencer module, where the Sequencer is chosen from a predetermined set of potential actors. With the Multiple Sequencer module, individual OP Stack-based chains have the autonomy to establish the specific mechanism that defines the set of eligible Sequencers and how a Sequencer is selected from this set. This modification grants greater flexibility to customize the Sequencing process, allowing chains to adapt and optimize their operations according to their unique needs and preferences.

Derivation

The Derivation Layer serves as the foundation for processing the raw data present in the Data Availability Layer, transforming it into processed inputs that are subsequently forwarded to the Execution Layer using the standard Ethereum Engine API. In this process, the Derivation Layer may also incorporate information from the current system state, as defined by the Execution Layer, to guide the parsing of the raw input data effectively.

Flexibility lies within the Derivation Layer’s design, as it can be customized to derive Engine API inputs from various data sources. Moreover, the Derivation Layer is closely linked to the Data Availability Layer since it must possess the ability to understand and parse any raw input data provided by this layer.

Ultimately, the Derivation Layer plays a pivotal role in converting raw data into processed inputs, enabling seamless interaction with the Execution Layer and facilitating efficient data processing within the OP Stack ecosystem.

Rollup

The Rollup module sources Engine API inputs from multiple data streams, including Ethereum block data, Sequencer transaction batches, Deposited transaction events, and other relevant sources.

Specifications and Source code is here.

Settlement Layer

The Settlement Layer serves as a mechanism on external blockchains, enabling the establishment of a view of an OP Stack chain’s state on those external chains, including other OP Stack chains. Each OP Stack chain can have one or more Settlement mechanisms on various external chains. These Settlement Layer mechanisms are read-only and allow external parties to make decisions based on the state of an OP Stack chain.

The term “Settlement Layer” originates from the fact that these mechanisms are commonly employed to manage withdrawals of assets from a blockchain. The withdrawal process involves proving the state of the target blockchain to a third-party chain and then facilitating the withdrawal based on that state. However, it is essential to note that the Settlement Layer’s purpose is not exclusively financial; rather, its core function is to enable a third-party chain to access the state of the target chain.

Once a transaction is published and finalized on the corresponding Data Availability Layer, it becomes immutable on the OP Stack chain. Barring any disruption to the underlying Data Availability Layer, the transaction cannot be modified or removed. While the transaction may not have been accepted by the Settlement Layer yet, due to the need to verify transaction results, its immutability on the OP Stack chain remains intact.

Attestation-based Fault Proof

The Attestation-based Fault Proof mechanism operates using an optimistic protocol to establish a view of an OP Stack chain. In optimistic settlement mechanisms, Proposer entities have the ability to propose what they consider to be the current valid state of the OP Stack chain. If these proposals remain unchallenged within a specific time frame, known as the “challenge period,” the mechanism assumes the proposals are correct.

In the Attestation Proof mechanism, a proposal can be invalidated if a certain threshold of pre-defined parties provide attestations to a valid state that differs from the state proposed. This introduces a trust assumption that at least a threshold number of the pre-defined participants will act honestly and provide accurate attestations.

In essence, the Attestation-based Fault Proof mechanism relies on the optimism that the proposed state is valid unless it is proven otherwise through a challenge process. The credibility of the mechanism depends on the integrity and participation of the pre-defined parties in providing accurate attestations to maintain the system’s reliability and security.

Specifications (called withdrawal transactions) and Source code is here.

Fault Proof Optimistic Settlement

The Fault Proof Optimistic Settlement mechanism closely resembles the Attestation-based Fault Proof mechanism but replaces the MultiSig challenger with a permissionless fault proving process. A properly constructed fault proof is capable of invalidating any incorrect proposals during the allocated challenge period. This mechanism relies on the trust assumption that the fault proof construction is accurate and reliable. Work on developing the Fault Proof mechanism is currently in progress.

Validity Proof Settlement

The Validity Proof Settlement mechanism relies on a mathematical proof to validate the correctness of a proposed view. A proposed state will only be accepted if it is accompanied by a valid proof. Consequently, this mechanism places a trust assumption on the accuracy and soundness of the validity proof construction. The system requires assurance that the provided validity proof is indeed reliable and verifiable before accepting the proposed state as valid.

Governance

The Governance Layer encompasses a comprehensive suite of tools and processes utilized to oversee system configuration, upgrades, and design choices within the OP Stack ecosystem. This layer operates at a higher level of abstraction, encompassing a diverse array of mechanisms deployed on a target OP Stack chain and even extending to third-party chains. Its influence spans across various layers of the OP Stack, playing a pivotal role in decision-making and management.

The Governance Layer is responsible for orchestrating and implementing critical aspects of the OP Stack, including system-wide changes, upgrades, and the overall design philosophy. It acts as a central hub for collective decision-making, ensuring alignment with the community’s goals and values. This abstract layer brings coherence and efficiency to the governance processes that impact the entire OP Stack ecosystem, fostering a well-organized and evolving framework for its sustainable development.

Multi Sig Contracts

Multi Sig Contracts are smart contracts that execute actions upon receiving a specified number of signatures from a predefined group of participants. These contracts are commonly utilized to manage upgrades of components within an OP Stack system. On Optimism Mainnet, Multi Sig Contracts are the current mechanism employed for handling bridge contract upgrades. The security of the Multi Sig Contract system depends on factors such as the number of participants, the required threshold for signatures, and the safety practices of individual participants. These elements collectively contribute to the overall security and reliability of the Multi Sig Contract system.

Governance Tokens

Governance Tokens play a pivotal role in decentralizing decision-making processes. While the specific functionalities of Governance Tokens may differ from one project to another, the most prevalent mechanisms enable token holders to participate in voting for certain project-related decisions. Voting can be conducted either directly by token holders themselves or through delegation, where token holders entrust their voting rights to representatives.

By holding Governance Tokens, individuals gain a say in a subset of decisions that the project faces. This empowers community members and stakeholders to actively participate in shaping the project’s direction, making it more democratic and inclusive. The flexibility of Governance Tokens allows projects to tailor their governance structures to suit their specific needs, fostering greater engagement and collective decision-making within the decentralized ecosystem.

--

--

Zeynep Miraç Yıldırım

Optimism Turkey Community Leader 🔴✨ | Marketing BanklessDAO | SheFi szn8 💫 | BanklessTR 🏴| solarpunk enjoyer 🌞 | Geophysicist 🌍🧗🏻‍♀️