Skip to main content

Witness retrieval

An execution witness is a record of the chain state that Zesu needs to re-execute a block's transactions. The execution client produces the witness; Zesu consumes it. Zesu doesn't hold any chain state of its own, and uses the witness to re-execute each block without access to the broader state.

warning

The execution witness specification is still being finalized and the retrieval method described here will likely change.

Longer-term proposals would deliver witnesses over the Engine API alongside block payloads. See execution-apis issues #741 and #773 for the latest proposals.

Why Zesu needs a witness

An execution client that holds the full chain state can load whatever a block needs at execution time. Zesu doesn't hold any chain state of its own, and to re-execute a block correctly, it needs a pre-assembled record of exactly the state that block touches. That record is the witness.

The connected execution client produces the witness as part of executing each block. It captures the pre-state values of every account, storage slot, and contract code that the block's transactions access, packages them into the witness, and makes the witness available to Zesu.

Witness vs. execution proof

The witness and the execution proof are both forms of proof, so it's worth distinguishing them up front. The witness is a set of Merkle proofs: each entry proves that a supplied state value belongs to the block's pre-state root. The execution proof is the zero-knowledge proof Zesu's execution produces, attesting that the block was executed correctly over that state.

The two serve different roles in the pipeline:

WitnessExecution proof
What it isMerkle proofs of pre-stateZero-knowledge proof of execution
RoleInput to Zesu's executionOutput of Zesu's execution
SizeMegabytesKilobytes
ConsumerZesuVerifiers
DistributionLocal to the proverDistributed to verifiers

In the current devnet setup, the witness is an intermediate artifact that doesn't travel beyond the prover. The execution proof is the compact, distributable certificate that verifiers use to confirm correct block execution.

How witnesses reach Zesu

Zesu receives a witness as part of an SSZ-encoded stateless block bundle (StatelessInput), which combines the execution payload and the witness into a single input. This is the canonical format Zesu consumes when it runs inside a zkVM. See Inputs and outputs for the input structure.

The execution client supplies the block data and witness through its own interface. Any conversion to the SSZ format Zesu consumes happens outside Zesu. Witness availability is bounded by what the execution client can serve, which limits how far back blocks can be re-executed.