The last update on technical decentralization and the OP Stack’s Fault Proof System shared that the system would showcase the full power of the OP Stack's modular architecture. This blog post explores this claim in more depth, with a deep dive into the elegant design of the system’s pre-image oracle as evidence.
Modularity and decoupling the Fault Proof System
The OP Stack’s modularity enabled the design of a decoupled Fault Proof System, enhancing its flexibility and adaptability. By decoupling the Fault Proof Program (FPP) from the Fault Proof Virtual Machine (FPVM), each component can evolve and be optimized independently, without constraints imposed by the other. This separation not only streamlines development and debugging processes but also fortifies the reliability and robustness of both the FPP and FPVM.
This modularity also allows for the integration of sophisticated components. One such component is the pre-image oracle that will bring immense flexibility and programmability to the OP Stack’s Fault Proof System.
Functional overview of the pre-image oracle
To understand the pre-image oracle, consider the challenge of a simple FP-VM: How can you consistently prove computation over various data? Proving computation becomes straightforward when narrowed down to one instruction via an interactive-bisection game: process one VM instruction from a pre-state to a post-state.
However, loading extensive L1 inputs and L2 pre-state into this VM isn't straightforward. Enter the pre-image oracle. It provides values upon program requests using keys. But it's more than a basic key-value store—it ensures only legitimate inputs are used, verifying the L2 state-transition based on L1 data.
This oracle makes retrieving inputs provable on-chain, akin to reading a file or accessing an API.
The pre-image oracle embodies "statelessness": verifying computation by presenting just-in-time essential data. Unlike stateless execution on L1, this method isn't hampered by network bandwidth. The interactive optimistic rollup approach changes the game; everything is efficiently managed onchain in the EVM.
What’s special about the OP Stack’s pre-image oracle?
- Tiny IO Steps: The pre-image oracle simplifies proof by reducing interactions with the VM state. It efficiently loads data in byte-sized chunks, ensuring a single neat memory change per instruction.
- Pre-image Hinting: The pre-image oracle can prepare these pre-images outside of the VM, where hints are provided just-in-time before pre-image requests, ensuring a seamless execution.
- Bootstrapping: Bootstrapping a new dispute is simplified by ensuring the same dispute program is embedded into the initial VM state, dispute specifics are loaded through the oracle during execution.
- Claim Verification: The oracle can also load the disputed claim into the VM, allowing the program to compare it against its computation results, rather than extracting the result.
- Running Programs Outside of the VM: something truly unique about the OP Stack’s pre-image oracle is that it allows you to run the program without the VM. As long as the oracle is served by the host program, it can operate on any platform, reducing overhead and providing seamless debugging and testing.
A composable pre-image oracle
The modular OP Stack can accommodate various types of FPVMs or state-transition programs. The beauty of the OP Stack’s pre-image oracle lies in its adaptability: it can be used across different instruction sets and different programs. Whether it’s a Go stack with op-node and op-geth, or a Rust stack with Magi and Reth, the same pre-image oracle fits all.
Moreover, this separation between VM and program allows for alternative VMs, like a RISC-V version of Cannon or even a ZK proof of MIPS. (!) Future pre-image verifications can be easily added without making drastic changes to the FPVM.
How does this impact the Fault Proof System?
The pre-image oracle's adaptability ensures the FPVM and FPP remain straightforward, flexible, and efficient. By allowing various implementations of the same protocol, it acts as a safety net, securing the OP Stack.
Interested in Fault Proofs? Check out this article, which shares more details about the design of the complete OP Stack Fault Proof System, and this article, which digs into how the multi-proof design of the OP Stack.