BTC
ETH
HTX
SOL
BNB
View Market
简中
繁中
English
日本語
한국어
ภาษาไทย
Tiếng Việt

YBB Capital: Crazy Multichain Universe, Crazy OP Stack

YBB Capital
特邀专栏作者
This article is about 6943 words, reading the full article takes about 10 minutes
A frenzy called "One-Click Linking" is about to begin. OP Stack is a "superchain" that can create Layer2 with just one click. This article provides a comprehensive analysis of the OP Stack architecture, the ZK elements in OP, and the security issues of Rollup.
AI Summary
A frenzy called "One-Click Linking" is about to begin. OP Stack is a "superchain" that can create Layer2 with just one click. This article provides a comprehensive analysis of the OP Stack architecture, the ZK elements in OP, and the security issues of Rollup.

Original author: YBB Capital Researcher Ac-Core

Preface

The main narrative direction of ETH has shifted from Layer 1 to Layer 2. If we still understand it as the narrative of "one-click token issuance" ERC-20, let's expand our imagination and get ready for a frenzy of "one-click chain deployment"! With the current unrivaled ecosystem and high TVL, Arbitrum has been leading the war between Layer 2 solutions, but can this temporary victory last long? Unlike the Layer 3 solution, Arbitrum Orbit, OP Stack is a "super chain" that can create Layer 2 with just one click. This article provides a comprehensive analysis of OP Stack architecture, ZK elements in OP, and the security issues of Rollup.

OP Stack opens the "super chain universe"

YBB Capital Researcher Ac-Core self-made

The narrative of the next bull market starts from where? Is it from the high-performance Layer 1, the continuing stacking of Layer 3, the ZK-based Layer 2, or the super chain of OP Stack? This is a very interesting and thought-provoking question. The title of "Ethereum Killer" is still the ultimate goal that countless public chains cannot surpass, and within this huge giant, there are many hidden super cores that cannot be ignored, one of which is: OP Stack.

What is OP Stack?

OP Stack can be understood as a set of open-source software components that allow anyone to build their own Layer 2 blockchain on top of Ethereum using Optimistic rollups. It moves most of the computation and storage off-chain while relying on Ethereum to ensure security and finality. From a technical standpoint, Optimism is mainly manifested in its tangible savings of a large amount of on-chain fees for users. OP Stack consists of four main components:

  • Mainnet: OP Mainnet is a cheap and fast Ethereum Layer 2 network that is compatible with the Ethereum Virtual Machine (EVM);

  • Contracts: Smart contracts that implement the core logic and functionality of OP Stack. The OP contracts include the State Transition System (STS), Fraud Prover (FP), State Commitment Chain (SCC), and Canonical Transaction Chain (CTC);

  • Services: Provides data availability, data synchronization, and communication services between Layer 1 and Layer 2;

  • Tools: Facilitates development, testing, deployment, monitoring, and debugging of OP Stack-based blockchains.

Superb openness:

OP Stack will be built as the infrastructure for a forkable modular extensible blockchain. To achieve this vision, all kinds of Layer 2 need to be integrated into a single Superchain, integrating originally isolated Layer 2 into a system with interoperability and composability, making launching Layer 2 as simple as deploying smart contracts on Ethereum today, moving from "one-click token issuance" to "one-click chain issuance". Essentially, the Superchain is a horizontally scalable blockchain network that shares Ethereum's security, communication layer, and development toolkit among different chains.

YBB Capital Researcher Ac-Core homemade

OP Stack (Over Powered Stack) will become the unified modular development stack behind the Superchain, where countless interconnected and communicative blockchains exist. The OP Stack stack is developed and maintained by the dedicated Optimism Collective and supports a shared open-source system for deploying new aggregated networks. At the same time, it is also a standardized open-source module. So, doesn't it sound like a Cosmos fully based on Ethereum security? In the beginning, it was said that ETH and ATOM complemented each other, but now OP Stack has become a Cosmos killer? Let's break down the definition of OP Stack:

A module is a data unit that any developer can insert into OP Stack. And the "standardization" of this Superchain means consensus on the standard of a module and it can be implemented by everyone. At the same time, being fully open-source means that it can be freely provided to anyone for development iteration and message requests. Developers have the ability to switch modules across different execution layers, consensus layers, settlement layers, and data availability layers of a chain.

For example, dYdX chose to leave Ethereum and switch to the Cosmos application chain because they wanted a more modular consensus layer on their own chain. I think this is a good start, allowing more independent Dapps to choose a public chain that is more suitable for their own development. The most representative one is Luna, although it was destroyed for some reasons. Fortunately, OP Stack solves this problem. Its design allows for easier code forking, enabling developers to easily abstract different components of the blockchain and modify them by inserting different modules.

OP Stack Design Principles:

  • Efficiency: You can use OP Stack to build anything and deploy a blockchain with just one click;

  • Simplicity: Utilize reusable code and existing development kits to enhance security and reduce maintenance complexity, achieving an overall lowering of barriers;

  • Scalability: Optimism Collective will fully open-source the main code of OP Stack.

In terms of architecture, OP Stack can be divided into six layers from bottom to top, namely DA Layer data availability layer, Sequencing Layer, Derivation Layer, Execution Layer, Settlement Layer, and Governance Layer. Each layer of OP Stack is modular API components that can be combined and decoupled as desired. The most critical ones are the DA data availability layer, execution layer, and settlement layer, which make up the main workflow of OP Stack.

  • DA data availability layer: It is the original data source of OP Stack and can use one or more data availability modules to obtain input data. Currently, Ethereum is the main DA layer, but more chains will join in the future;

  • Execution Layer: The status structure in the OP Stack, which provides possibilities for EVM or other VMs, increases support for Layer 2 transactions initiated on Ethereum, and adds additional Layer 1 data costs to each transaction, which are the overall costs of submitting transactions to Ethereum.

  • Settlement Layer: The destination of Layer 2 transaction data on the OP Stack, which sends information to the target blockchain for final settlement after confirmation on Layer 2. In the future, it is also expected to integrate validity proof mechanisms such as ZK to bridge the gap between different chains, and even connect the islands between OP Stack Layer 2 and ZK Stack Layer 2.

We have observed that the recent development of the OP ecosystem has seen some projects with ZK elements. Let's imagine that a certain Optimistic rollup wants to transform itself into a ZK rollup, no problem! Just replace its fraud proof module with a validity proof module for the settlement layer. If a certain chain wants to use Celestia for its data availability layer, no problem! Just replace Ethereum with Celestia. If you want to replace the EVM in the execution layer with another virtual machine, unfortunately, this can only be a technical possibility for OP Stack. Just like the emergence of such a situation in the superchain world gave birth to a popular saying – "Polygon: I want to be the Cosmos of ZK Layer 2! Optimism: I want to be the Cosmos of OP Layer 2! Cosmos: Then who am I?"

OP Stack Rule:

YBB Capital Researcher Ac-Core self-made

Ethereum's infinite block space is a crucial step towards achieving large-scale applications. However, this expansion has also brought about fragmentation and new challenges for permissionless deployment. Now, each new OP Stack chain grows independently in its own domain without a direct method for sharing standards and improvements. Users and builders also face significant challenges in individually evaluating numerous different chains based on security, quality, and neutrality. To achieve a superchain, the OP Stack needs to transition from an independent and decentralized block space to a unified chain collective that is dedicated to an open and decentralized block space. The "chain rule" establishes guiding principles for optimistic governance and superchain formation. Optimistic governance shifts from managing individual chains to managing shared standards among multiple chains, defining the attributes required to be part of a superchain, while prioritizing user protection in transactions on the superchain. Fundamentally, the "chain rule" is a social contract (not a legal contract), hence active community discussions are critical. Its presence enables the superchain to guarantee the following characteristics:

  • Ensuring homogeneity, neutrality, and openness of the block space: Commitment to the chain rule is a commitment to protecting the users, developers, and other stakeholders of the chain. Regardless of the size, if a chain is part of the superchain, it can credibly demonstrate the homogeneity, neutrality, and openness of its block space with the support of optimistic governance.

  • Benefiting from continuous improvements: Shared upgrades mean that the superchain can always access the best technology without the need for self-maintenance.

  • Providing better and more usable infrastructure: Since all chains within the superchain are credibly committed to a common standard, they can collaborate to ensure the availability and cost-effectiveness of critical services such as indexing and sorting.

Questions worth considering:

Can OP Stack reciprocate to OP?

OP Token's use case is to support the Basechain method, where a portion of the income is given back to Optimism Collective. The revenue of the "Treasury" relies on its own "value" and creating more narratives to ultimately impact the token price, similar to the logic of ATOM in the secondary market. This solution may be the most optimal one currently, and if more chains follow the Basechain method, Optimism Collective will benefit. Does this remind us of UNI? Both projects are powerful, but their tokens only have value in terms of voting and governance. However, the difference lies in the fact that Layer 2 faces the problem of centralized sequencers. Even if Layer 2 tokens are only used for some form of leader selection (rather than consensus voting), the value of sorting rights will still accumulate to the Rullop token.

At the same time, on July 25th, the OP team released the Law of Chain proposal, which aims to standardize the profit-sharing model for all chains adopting the OP Stack. This will bring more income to the entire OP system (such as the aforementioned OP Stack rules). This can be considered analogous to the shared security model of Cosmos.

Differences between OP Stack and ZK Stack:

OP Stack: Multiple chains, single choice

As mentioned above, OP Stack adopts a similar multi-chain model as Cosmos, but with only one choice. This is because OP Stack requires each chain to verify transactions on other chains. Otherwise, waiting days for results on Layer 1 would be necessary. Therefore, a single and shared sequencer, centralized MEV allocation, and protection through agreements and governance are the only way to achieve seamless interoperability for Optimistic rollups across different chains.

ZK Stack: Multiple chains, multiple choices

Unlike OP Stack, ZK Stack can also have multiple chains, but it has various options and can choose its own sorter to handle MEV in its own way, and is protected by mathematics and code (note: OP Stack is protected by legal contracts and governance). This is because if ZK adopts a specified sharing or a very small set of threads, they can blindly trust each other based solely on mathematics, making zero-knowledge proofs lose their value.

ZK Elements in OP Stack

YBB Capital Researcher Ac-Core Production

OP Stack is a completely open architecture that enables the possibility of zkvm, zkmips, zkwasm, and zkevm in the ecosystem. However, compared to "traditional ZK", OP Stack also produces some different ZK elements. This makes us can't help but think that perhaps in the near future, there will be a dream collaboration between OP rollup and ZK rollup.

Implementing Zero-Knowledge Proofs (ZKP) for OP:

According to the latest progress, Mina's team behind plans to implement the zkmips vm on the OP Stack using their own plonk system + kzg commitment + folding algorithm nova. Although this is just a recent proposal and there may be many immature aspects, it is worth exploring. The mission of this project team is to achieve secure and low-latency cross-chain communication between Layer 2, Layer 1, and various OP chains through zero-knowledge proofs. This is a zero-knowledge proof (ZKP) for a well-supported Instruction Set Architecture (ISA), which can prove the behavior of Optimism fault-tolerant programs and lay the foundation for proving any OP Stack-based blockchain system.

YBB Capital Researcher Ac-Core Homemade

Completing this task means implementing a zero-knowledge proof (ZKP) system that can prove OP fault-tolerant programs using the Instruction Set Architecture (ISA) supported by golang compilers, such as MIPS, RISC-V, or WASM [2]. In addition, the proof system must also prove the state transition between two blocks of the standard configuration OP Stack chain, thereby proving its feasibility in practice. In addition to proving the standard execution trace of the ISA, support for fault-tolerant programs introduces additional requirements [1].

Specifically, the fault-tolerant program introduces the concept of a Pre-image Oracle [3], which uses special System calls [4] to load external data into the program. Each Fault Proof VM [5] is responsible for implementing a mechanism through which the hash value of certain data is placed in a specific location in memory and is executed by a system call, and then the pre-image of that hash value is loaded into memory for program use. Pre-image Oracle is also used to bootstrap the initial input for the program.

Attempt of Decentralized Sorter:

Espresso Systems  announced on July 21, 2023, that the proposal for decentralized sorting and validation for the OP Stack leadership election has been accepted, making them contributors to OP Stack and Superchain. The main protocol of this project, HotShot, is a high-speed consensus protocol that enables Ethereum validators to participate through re-staking, aiming to achieve the same scale as Ethereum validator set. Additionally, the project has developed Espresso Sequencer, which integrates fully featured Zk-rollup, particularly the branch of Polygon zkEVM.

What is a leadership election?

A leadership election[6] refers to the ability in a distributed system for different leaders to be responsible for creating the next specified state transition. In blockchain, leader elections allow different block producers to generate blocks at different times, and the leader election algorithm can be competitive or non-competitive.

In the case of proof of work, a competitive leader election algorithm means that there are many potential entities vying to become a leader at the same time. A non-competitive leader election algorithm refers to only one known leader at a specific point in time. In the case of Ethereum's Gasper, a non-competitive leader election algorithm means that there is only one known entity at a specific time, with no other way for another potential entity to become the leader at that time.

In the case of separating the proposer network and the builder network (i.e., the block builder network is only responsible for selecting transaction orders, and the proposer network is only responsible for signing blocks), a single entity responsible for generating blocks at a certain moment is transformed into many possible entities that compete in the builder network to construct the most profitable potential blocks at that moment. Additionally, due to the existence of MEV, this competition is reintroduced.

Understanding the various second-order effects of leadership election mechanisms between different OP Stack chains is challenging. Currently, treating leadership election as a mechanism is the most popular approach because it enables more decentralized sorting. It is important to note that this solution does not guarantee absolute decentralization of the sorter, so caution is advised when considering decentralized sorter problems.

Are Rollups Really Secure?

How Ethereum Works:

The principle of Ethereum is that each node stores and executes every transaction submitted to it by users. This high level of security also makes the entire network very costly, so it needs to be scaled for the entire network, which is where the Rollup solution comes in. In simple terms, Rollup = a set of Layer 1 contracts + self-contained network nodes of Layer 2, which means on-chain smart contracts + off-chain aggregators. It relies on Ethereum for settlement, consensus, and data availability, and only handles the execution of the Rollup itself.

  • On-chain smart contracts represent its trust model, which is a smart contract on Ethereum that leverages Ethereum's security;

  • Off-chain aggregators represent their ability to execute and aggregate transactions off-chain, compressing large batches of transactions and ultimately placing them on the Ethereum mainnet to achieve faster and cheaper goals.

The Layer 2 network consists of several components, with the Sequencer component being the most important. It is responsible for receiving transaction requests on Layer 2, determining their execution order, and packaging transaction sequences into batches, which are then sent to the Rollup contract on Layer 1. It should be noted that before proceeding with the following text, it is important to understand the fact that, as shown in the reference diagram below, all Layer 2 Rollups on Ethereum currently have centralized sequencers.

Image Source: Official Twitter Screenshot

Issue with centralized sequencers:

Full nodes of Layer 2 can obtain transaction sequences in two ways: directly from the sequencer or by reading transaction batches sent to Layer 1, with the latter having stronger immutability. Since transaction execution changes the state of the blockchain ledger, Layer 2 full nodes must not only obtain the order of transactions but also synchronize the ledger state with the sequencer. Therefore, the task of the sequencer is not only to send transaction batches to the Layer 1 Rollup contract but also to transmit the updated state results (StateRoot/StateDiff) after transaction execution to Layer 1. In simple terms, the sequencer's job is to process and order transactions to be added to the blockchain, handling transactions in batches, and publishing them to the Layer 1 smart contract.

For Layer 2 full nodes, as long as they obtain the transaction sequence on Layer 1's Rollup and the original StateRoot, they can reconstruct the Layer 2 blockchain ledger and calculate the latest StateRoot. Conversely, if the StateRoot calculated by Layer 2 full nodes themselves is inconsistent with the StateRoot published by the sequencer to Layer 1, it indicates fraudulent behavior by the sequencer. In conclusion, compared to Layer 2's own network, Layer 1 will be more decentralized, trustless, and secure.

YBB Capital Researcher Ac-Core

OP Stack:

So here's the question, can Layer 2 forge some non-existent or erroneous transactions, such as transferring Layer 2 Token assets to the runner's address on the sequencer, and then transferring these Token assets to Layer 1, thereby stealing user assets? The answer is: it is completely possible to do so. Therefore, when facing the potential risks of fraud in the sequencer, different types of Rollups adopt different response measures.

Let's take Optimistic Rollup as an example. It allows Layer 2 full nodes to provide Fraud Proofs, proving that the data published by the sequencer on Layer 1 is incorrect. However, for Optimism without Fraud Proofs, if it really wants to steal Layer 2 user assets through the sequencer, it only needs to let the sequencer's operator forge transaction instructions and transfer other people's assets on Layer 2 to their own address. Finally, through the Rollup's built-in Bridge contract, the stolen coins can be transferred to Layer 1.

To address this potential issue, the current solutions rely on two methods: firstly, reaching a "consensus" through community members and social media for public scrutiny, and secondly, relying on OP as the official endorsement. Therefore, based on the above theory, the security of OP Rollup depends on the existence of an honest Layer 2 full node that can provide Fraud Proofs, as mentioned in the section "Difference between OP Stack and ZK Stack": OP Stack is a multi-chain single choice.

YBB Capital Researcher Ac-Core self-made

ZK Stack:

Let's discuss ZK Stack. In the ZK rollup network, there are Prover nodes that are responsible for publishing transaction batches for the aggregator and generating validity proofs. These validity proofs are verified by specialized contracts on Layer 1. Once the proofs for the batches and their corresponding StateRoot/StateDiff pass the verification by the Verifier contract, the transactions are confirmed. Unlike the OP Stack, which relies solely on Layer 2 full nodes to solve aggregator fraud, ZK rollup also utilizes Validity Proofs. The official bridge of ZK rollup only allows withdrawal transactions that have been validated through validity proofs. This makes it more reliable in terms of security compared to Optimism, as mentioned in the section "Differences Between OP Stack and ZK Stack" above: ZK Stack is multi-chain and multi-choice.

In theory, the security of ZK rollup is ensured by the Verifier contract on Layer 1 or, more precisely, by the final confirmation of transactions by Layer 1 nodes. In contrast to OP rollup, which relies on the minimum number of honest Layer 2 full nodes capable of publishing fraud proofs, both solutions inherit the security of Layer 1 (ETH). However, strictly speaking, this may not always be the case. Nevertheless, it is currently the optimal solution, and compared to other public chains, the security of Ethereum, developed over many years, is unquestionably reliable.

Similar to the blockchain trilemma, the comprehensive user experience of a product also seems to involve a trilemma: security, simplicity, and efficiency. Compared to the OP Stack, ZK Stack places more trust in mathematics and code to enhance overall security, thereby significantly increasing overall complexity. Therefore, there are a few recurring topics when it comes to ZK:

YBB Capital Researcher Ac-Core Homemade

  • Delay Issue: ZK rollup still needs to solve the delay issue of data transmission from Layer 2 nodes to Layer 1. Similar to the need for packaging boxes in express delivery, every time the sequencer or prover sends data to Layer 1, there will be a fixed cost;

  • Speed Issue: ZK rollup faces a challenge in that the generation of validity proofs is relatively slow. Although the sequencer can execute thousands of transactions within 1 second, it may take several hours to generate validity proofs for these transactions;

  • Cost Issue: In order to reduce overall costs, many ZK rollup solutions adopt the strategy of "aggregating multiple proofs and sending them to Layer 1 at once". This means that the prover does not immediately send a proof to Layer 1 after generating it, but waits until multiple proofs are generated, aggregates them together, and sends them to the verifier contract on Layer 1 at once;

  • Quantity Issue: If the number of initiated transactions is not sufficient, the sequencer may delay sending data to Layer 1. For example, during periods of market inactivity, certain Rollup networks may only send transaction batches to Layer 1 once every half an hour.

Regarding the issue of a more suitable decentralized sequencer solution, modularity may be the optimal approach because modularity is equivalent to greater customization. The main options in current decentralized tools are as follows:

- Single Sequencer & POA

- Based rollup

- DVT x Sequencer

- Shared Sequencer

- Bootstrap a New Sequencer Set

We believe that many of the above issues can be further resolved through technology in the near future. For example, reducing the generation time of validity proofs. Optimism promises to release a fraud-proof system soon, and Ethereum's Danksharding solution will greatly reduce the data cost of Rollup. The problem of decentralized sequencer is also being tackled, providing effective solutions to the above issues.

Conclusion: Narrative Trend

YBB Capital Researcher Ac-Core Homemade

Hyperlinks and superextensions have always been the focus of attention for the community, and although various projects are still in early development stages, they have all brought stronger storytelling to Ethereum as a whole. Now we can see that OP Stack has gained more adoption, with many prominent public chains joining it, such as Coinbase, opBNB, Zora, Worldcoin, and many others, which have given OP Stack strong endorsements. Including the recent announcement on June 26th, zkSync introduced a modular open-source framework called ZK Stack for building custom ZK rollups, which many consider as zkSync's trump card against OP Stack. On one hand, there is OP Stack with its first-mover advantage, and on the other hand, there is ZK Stack with its mathematical advantage. In conclusion, any value on Layer 2 can be accumulated into Rollup tokens. The Layer 2 scalability battle has just begun. How do you perceive this smokeless war of Layer 2?

Explanatory document:


[ 1 ]https://github.com/ethereum-optimism/optimism/blob/develop/specs/fault-proof.md#fault-proof-program

[ 2 ]https://github.com/ethereum-optimism/ecosystem-contributions/issues/61

[ 3 ]https://github.com/ethereum-optimism/optimism/blob/develop/specs/fault-proof.md#pre-image-oracle

[ 4 ]https://en.wikipedia.org/wiki/System_call

[ 5 ]https://github.com/ethereum-optimism/optimism/blob/develop/specs/fault-proof.md#fault-proof-vm

[ 6 ]https://github.com/ethereum-optimism/ecosystem-contributions/issues/63

Reference article:

https://mp.weixin.qq.com/s/ezSpKkoUoyFtoYd2cLoOzw


Optimism
Layer 2
ZKP
Welcome to Join Odaily Official Community