Skip to content

0xSemftovo/proofsmith

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

ProofSmith

ZK proof generator for smart contract state verification on EVM-compatible blockchains.

Overview

ProofSmith fetches on-chain contract state at a specific block and generates a cryptographically verifiable proof bundle. The bundle includes:

  • State hash — SHA-256 commitment over balance, nonce, code, and storage
  • Merkle tree — built from storage slot proofs for selective verification
  • Storage proofs — EIP-1186 eth_getProof responses for requested slots
  • State transition verification — compare two proof bundles to verify legitimate transitions

Installation

cargo build --release

Usage

proofsmith \
  --contract 0xContractAddress \
  --rpc https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY \
  --block 18000000 \
  --output proof.json \
  --slots 0x0,0x1,0x2

Options

Flag Description
--contract Contract address to generate proof for
--rpc Ethereum JSON-RPC endpoint URL
--block Block number to snapshot state at
--output Output path for the JSON proof bundle
--slots Comma-separated storage slot indices (default: 0x0–0x3)

Output Format

The proof bundle is a JSON file containing:

{
  "contract": "0x...",
  "block_number": 18000000,
  "block_hash": "0x...",
  "state_hash": "0x...",
  "code_hash": "0x...",
  "balance": "1000000000000000000",
  "nonce": 42,
  "storage_proofs": [...],
  "merkle_root": "0x..."
}

Testing

cargo test

License

MIT

About

ZK proof generator for smart contract state verification on EVM blockchains

Topics

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages