Crate sp1_cc_client_executor

Source
Expand description

§RSP Client Executor Lib

This library provides the core functionality for executing smart contract calls within a zero-knowledge virtual machine (zkVM) environment. It includes utilities for blockchain state validation, EVM execution, and proof generation.

§Main Components

  • ClientExecutor: The primary executor for smart contract calls in zkVM
  • ContractInput: Input specification for contract calls and creations
  • ContractPublicValues: Public outputs that can be verified on-chain
  • Anchor: Various blockchain anchoring mechanisms for state validation

§Features

  • Execute smart contracts with full EVM compatibility
  • Validate blockchain state against Merkle proofs
  • Support for multiple anchor types (block hash, EIP-4788, consensus)
  • Log filtering and event decoding
  • Zero-knowledge proof generation for contract execution

Modules§

io
EVM sketch input structures and implementations.

Structs§

BeaconAnchor
A beacon chain anchor that provides cryptographic proof linking data to beacon chain state.
BeaconStateAnchor
An anchor that combines beacon chain state with cryptographic proof for state transition verification.
BeaconWithHeaderAnchor
An anchor that combines an execution block header with beacon chain verification.
ChainedBeaconAnchor
A chained anchor that enables verification through multiple beacon chain state transitions.
ClientExecutor
An executor that executes smart contract calls inside a zkVM.
ContractInput
Input to a contract call.
ContractPublicValues
Public values of a contract call.
HeaderAnchor
A simple anchor that directly references an Ethereum execution block header.

Enums§

Anchor
Ethereum anchoring system for verifying block execution against beacon chain roots.
AnchorType
BeaconAnchorId
Identifier for a beacon chain anchor, specifying how to locate the anchor in beacon chain history.
BeaconBlockField
A field identifier for beacon block components that can be verified via Merkle proofs.
ClientError
Error types for the client library.
ContractCalldata
The type of calldata to pass to a contract.
Genesis

Constants§

HISTORY_BUFFER_LENGTH

Functions§

get_beacon_root_from_state
Retrieves a beacon root from Ethereum state using EIP-4788 storage.
hash_genesis
rebuild_merkle_root
Rebuilds a Merkle tree root from a leaf value and its branch proof.