Disclamer: This project is under development, playing around with sp1 and alloy & reth codes
program that verify storage proof and return valid value of evm state
-
- input : pass rpc
get_ethProof
response value as an input of the program
- input : pass rpc
-
- process : calculate storage trie's root base on given path - probably need to add trie implementation, there is gold reth code that im referring
-
- output : provide valid storage value from given key ( slot )
Just sake of convineience, debugging in there https://github.com/rkdud007/playground/blob/main/sp1/src/main.rs for dev purpose
Before, follow SP1 installation
terminal 1:
❯ cd program
❯ cargo prove build
terminal 2:
❯ cd script
❯ cargo run --release
pub struct EIP1186ProofResponse {
pub address: Address,
pub balance: U256,
pub code_hash: H256,
pub nonce: U64,
pub storage_hash: H256,
pub account_proof: Vec<Bytes>,
pub storage_proof: Vec<StorageProof>,
}
pub struct StorageProof {
pub key: H256,
pub proof: Vec<Bytes>,
pub value: U256,
}
with alloy
depend on keccak
precompile library,
with computing 6 keccak hash speed around:
Proof generation time: 8s
verification is always around
Verification time: 406.374542ms
The relevat code is in this commit