Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rkdud007/sp1-storage-proof
storage proof made by sp1
https://github.com/rkdud007/sp1-storage-proof
Last synced: 8 days ago
JSON representation
storage proof made by sp1
- Host: GitHub
- URL: https://github.com/rkdud007/sp1-storage-proof
- Owner: rkdud007
- Created: 2024-02-14T19:29:52.000Z (9 months ago)
- Default Branch: storage-proof
- Last Pushed: 2024-09-20T06:12:52.000Z (about 2 months ago)
- Last Synced: 2024-10-04T11:58:39.981Z (about 1 month ago)
- Language: Rust
- Homepage:
- Size: 29.3 MB
- Stars: 24
- Watchers: 2
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# sp1-storage-proof
Disclamer: This project is under development, playing around with sp1 and alloy & reth codes
## Goal
```
program that verify storage proof and return valid value of evm state
```- 1. input : pass rpc `get_ethProof` response value as an input of the program
- 2. process : calculate storage trie's root base on given path - probably need to add trie implementation, [there is gold reth code](https://github.com/paradigmxyz/reth/blob/39eb6c6d6e7a523705b34f8dc960148e37367d12/crates/trie/src/trie.rs#L467) that im referring
- 3. output : provide valid storage value from given key ( slot )## Development
Just sake of convineience, debugging in there
https://github.com/rkdud007/playground/blob/main/sp1/src/main.rs for dev purpose## Quick Start
Before, follow [SP1 installation](https://succinctlabs.github.io/sp1/getting-started/install.html)
terminal 1:
```
❯ cd program
❯ cargo prove build
```terminal 2:
```
❯ cd script
❯ cargo run --release
```## Input data format
```rust
pub struct EIP1186ProofResponse {
pub address: Address,
pub balance: U256,
pub code_hash: H256,
pub nonce: U64,
pub storage_hash: H256,
pub account_proof: Vec,
pub storage_proof: Vec,
}pub struct StorageProof {
pub key: H256,
pub proof: Vec,
pub value: U256,
}
```## FYI
with `alloy` depend on `keccak` [precompile library](https://succinctlabs.github.io/sp1/writing-programs/patched-crates.html),
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](https://github.com/rkdud007/sp1-storage-proof/tree/64eb31a88c5566dd442d5d4f4f5b11d8ba50867cs)