Cross-Chain Storage Proofs
Storage Proofs allow smart contracts on one blockchain to securely access and verify data from another blockchain. This cross-chain functionality is crucial for building interoperable decentralized applications. Let's explore how this process works and the role of key smart contracts involved.
The Basic Flow
Data Request: A smart contract on Chain B (e.g., Starknet) needs to verify data from Chain A (e.g., Ethereum).
Proof Generation: Off-chain systems generate cryptographic proofs of the requested data from Chain A.
Proof Submission: These proofs are submitted to Chain B.
Verification: Smart contracts on Chain B verify the proofs and make the data available for use.
Key Smart Contracts
Several smart contracts work together to make this process secure and efficient:
CommitmentsInbox (on Chain B)
Purpose: Receives and processes data from Chain A.
Function:
Accepts block headers and other critical data from Chain A.
Verifies the authenticity of this data using cryptographic signatures.
Stores the verified data for further use.
HeadersStore (on Chain B)
Purpose: Efficiently stores and manages a large number of block headers from Chain A.
Function:
Uses a data structure called a Merkle Mountain Range (MMR) to store block headers.
Allows for efficient verification of historical block headers.
FactsRegistry (on Chain B)
Purpose: Stores and manages verified blockchain data from Chain A.
Function:
Stores proven account balances, storage values, and other blockchain data.
Provides functions for other smart contracts to access this verified data.
L1MessagesProxy (on Chain A)
Purpose: Facilitates sending messages from Chain B back to Chain A.
Function:
Aggregates messages from Chain B.
Sends these messages to Chain A in a gas-efficient manner.
The Cross-Chain Proof Process
Initiation: A smart contract on Chain B requests data from Chain A.
Data Transmission:
The L1MessagesProxy on Chain A collects relevant block headers and data.
This information is sent to the CommitmentsInbox on Chain B.
Data Processing:
The CommitmentsInbox verifies the incoming data.
Verified block headers are stored in the HeadersStore.
Proof Generation and Verification:
Off-chain systems generate cryptographic proofs of the requested data.
These proofs are submitted to Chain B.
The FactsRegistry verifies these proofs against the data in the HeadersStore.
Data Availability:
Once verified, the data is stored in the FactsRegistry.
Smart contracts on Chain B can now access and use this verified data from Chain A.
Security and Efficiency
This system ensures security through cryptographic verification at each step. It's also designed for efficiency:
Only essential data (like block headers) is regularly transmitted between chains.
Complex proofs are generated off-chain to minimize on-chain computation.
Data structures like the Merkle Mountain Range allow for efficient storage and verification of large amounts of historical data.
By using this system of smart contracts and cryptographic proofs, Herodotus enables secure and efficient cross-chain data access, opening up new possibilities for blockchain interoperability.
Last updated