CSV Adapter Ethereum
Ethereum adapter for CSV (Client-Side Validation) with nullifier-based seals and MPT proofs.
Overview
This crate implements the AnchorLayer trait for Ethereum, using nullifier registration as L3 Cryptographic single-use enforcement. Unlike Bitcoin's structural single-use, Ethereum requires explicit nullifier tracking via smart contracts.
Key Features
- Nullifier Seals: Cryptographic single-use enforcement via smart contract registry
- MPT Proofs: Merkle Patricia Trie inclusion proofs
- LOG Events: Commitment publication via Ethereum events
- Alloy Integration: Full compatibility with Alloy 0.9 ecosystem
- Light Client: State root verification without full node
- Sepolia/Testnet: Full testnet support
Installation
Or in your Cargo.toml:
[]
= "0.1"
Features
| Feature | Description | Default |
|---|---|---|
rpc |
Enable full RPC client with Alloy integration | ❌ |
production |
Enable all production-ready features (rpc) |
❌ |
Quick Start
Creating an Ethereum Anchor Layer
use EthereumAnchorLayer;
// Create adapter with mock RPC for testing
let adapter = mock;
// Or with real RPC (requires `rpc` feature)
// let adapter = EthereumAnchorLayer::from_rpc(rpc_url, chain_id)?;
Working with Nullifier Seals
use EthereumAnchorLayer;
use ;
let adapter = mock;
// Create a nullifier-based seal
let nullifier = new;
let seal = adapter.create_seal_from_nullifier?;
// Publish a commitment
let commitment = new;
let anchor = adapter.publish?;
MPT Proof Verification
use verify_mpt_proof;
// Verify a storage proof against state root
let is_valid = verify_mpt_proof?;
Architecture
EthereumAnchorLayer
├── Nullifier Registry ← L3 Cryptographic single-use
├── MPT Proofs ← Merkle Patricia Trie verification
├── LOG Events ← Commitment publication
├── Finality Checker ← Block finality verification
└── Alloy RPC ← Ethereum node interaction (optional)
Seal Lifecycle
- Create: Generate a nullifier hash (H(right_id || secret))
- Register: Submit nullifier to smart contract (on-chain)
- Anchor: Emit LOG event with commitment hash
- Verify: MPT proof confirms inclusion in state root
License
This project is dual-licensed under either:
- Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
Contributing
We welcome contributions! Please see our GitHub repository for more information.