OP Stack
Storage Proofs on Optimism and OP Stack Blockchains
Last updated
Storage Proofs on Optimism and OP Stack Blockchains
Last updated
The first step in the Storage Proof Workflow is always accessing the block hash. Due to this, to enable cross-chain data access on OP Stack chains, we need to understand what data gets committed to L1.
Since the launch of Optimism Bedrock, the block hash of an L2 block is committed to L1. The structure of the block header on Optimism Bedrock is the same as on EVM.
The L2OutputOracle contract emits OutputProposed events when new L2 outputs are proposed. The event structure is:
Calling the getL2Output
read method using l2OutputIndex
returns output. This pre-image of outputRoot is made of the following values:
The l2_block_hash
can be decoded from the pre-image and sent to a Header Store smart contract deployed on Optimism or other OP Stack rollups.
GitHub: https://github.com/HerodotusDev/opstack_indexer
The OP Stack Indexer is responsible for monitoring Ethereum for all OP Stack events. Output Roots are indexed in a database. The repository supports OP Stack rollups such as Optimism, Base, and Zora.
Step 1: Access the block hash.
Step 2: Send block hash to Commitments Inbox, Headers Store and Facts Registry smart contracts, which are deployed on OP Stack.
Step 3: Proceed with Storage Proof Workflow.
Step 1: Index the block header(pre-image) of an OP Stack block hash that has already settled on L1. This can be done using the OP Stack Indexer.
Step 2: Send block hash to Commitments Inbox, Headers Store and Facts Registry smart contracts, which are deployed on OP Stack.
Step 3: Proceed with Storage Proof Workflow.
Step 1: Index the block header(pre-image) of an OP Stack block hash that has already settled on L1. This can be done using the OP Stack Indexer.
Step 2: Send block hash to the Commitments Inbox, Headers Store and Facts Registry smart contracts, which are deployed on Starknet.
Step 3: Proceed with Storage Proof Workflow.