Stateless Ethereum block validation using execution witnesses.
stateless provides types and functions for validating Ethereum blocks without access to a full node's persistent database. Instead, it relies on pre-generated witness data that proves the specific state accessed during block execution.
It is built on top of reth and revm, and is designed to be no_std compatible for use in constrained environments such as zkVMs.
- Witness verification — The execution witness is verified against the parent block's state root using a sparse Merkle Patricia trie.
- Block execution — The block is executed in-memory using a witness-backed database (
WitnessDatabase). - Consensus validation — Post-execution consensus checks are performed.
- State root computation — The post-state root is calculated and compared against the block header.
The primary entry point is stateless_validation:
use stateless::{stateless_validation, ExecutionWitness};
let (block_hash, output) = stateless_validation(
block,
public_keys,
witness,
chain_spec,
evm_config,
)?;The stateless crate is #![no_std] compatible and builds for RISC-V targets (riscv32imac-unknown-none-elf), making it suitable for use in zkVM environments.
To run the Ethereum Foundation blockchain tests with stateless validation:
# From the repository root:
./scripts/run_ef_tests.sh default
./scripts/run_ef_tests.sh zethOr manually:
# From the repository root:
./scripts/setup_ef_tests.sh
EF_TEST_TRIE=default cargo test -p ef-tests --release --features "asm-keccak ef-tests"Contributions are welcome! Join the conversation in the Telegram group.
Licensed under either of Apache License, Version 2.0 or MIT license at your option.