Skip to main content

CLI reference

Complete reference for the z6m_prover binary — every flag, subcommand, default, and known quirk. The binary ships in the somnergy/z6m_prover docker image, or builds from source with make z6m_prover (landing at prover/target/release/z6m_prover); see Running the prover for setup and workflows. This page is the dry list.

There are three invocation forms:

z6m_prover --service [flags] # continuous fetch/execute/prove loop
z6m_prover --test-service [flags] # offline execution of downloaded blocks or EEST fixtures
z6m_prover <subcommand> [flags] # one-shot: fetch | execute | prove | setup | verify

Running with no mode and no subcommand exits with an error. A .env file in the working directory is loaded automatically at startup, so environment variables such as SP1_PROVER can live there (see Environment variables).

Top-level flags

These flags precede any subcommand. Most only have an effect in --service or --test-service mode; the mode column says which.

Mode selection

FlagTypeDefaultDescription
--servicebooloffRun the continuous prover service. Requires --rpc-url. Processes blocks from --start-block (default: chain head + 1) onward, fetching block + witness and proving/executing per the interval flags.
--test-servicebooloffOffline test mode; conflicts with --service and cannot be combined with a subcommand. With --test-dir, executes EEST fixtures from that directory; otherwise requires --start-block and --end-block and executes already-downloaded bundles from --data-dir. No RPC access, no proving, CPU execution only.

Block range and intervals (service modes)

FlagTypeDefaultDescription
--start-blockintegerchain head + 1First block to process. Required by --test-service unless --test-dir is given.
--end-blockintegerfollow chain headLast block to process, inclusive; the service exits after it (after draining in-flight work). Without it the service polls the RPC head and runs until stopped.
--prove-everyintegerunsetProve blocks whose number is divisible by N. 0 or unset means never. Service mode only.
--execute-everyintegerunsetExecute (without proving) blocks whose number is divisible by N. 0 or unset means never; skipped for blocks that also match --prove-every. In --test-service without --test-dir it defaults to 1 (every block) and 0 is rejected.
--download-onlybooloffService mode: fetch block + witness bundles only, skipping proving and executing. Takes precedence over --prove-every and --execute-every.
--save-all-responsesbooloffAlso save the raw RPC JSON (block<N>.json, blockRlp<N>.json, executionWitness<N>.json) next to each block's flat bundle. In service mode this additionally fetches blocks that match no prove/execute interval (which are otherwise skipped entirely, not even fetched).

Inputs and outputs

FlagTypeDefaultDescription
--rpc-urlstringEthereum JSON-RPC endpoint; must expose debug_getRawBlock and debug_executionWitness. Required by --service; also serves as the fallback for the fetch subcommand's own --rpc-url.
--data-dirpathtempRoot data directory (e.g. /mnt/data, not /mnt/data/blocks). Block artifacts go to <data-dir>/blocks/<N>/; execution and proving logs are appended at the root.
--proof-typestringcompressedProof mode for service-mode proving: core, compressed, groth16 or plonk. Unknown values silently fall back to compressed. The prove subcommand accepts but ignores it (see below).
--test-dirpathDirectory of EEST fixtures for --test-service, scanned recursively for .mfbd/.json files.
--max-file-sizeinteger20971520Skip EEST test files larger than this many bytes (20 MiB); 0 means no limit. Used only by --test-service --test-dir.
--execution-log-filepathexecutionLogs.log in --data-dir or --test-dirExecution log path. Only honored by --test-service; the live service and the execute subcommand always append to <data-dir>/executionLogs.log.

Ethproofs reporting (service mode)

FlagTypeDefaultDescription
--ethproofs-endpointstringEthproofs API base URL.
--ethproofs-tokenstringEthproofs API token.
--ethproofs-cluster-idintegerCluster id to report under.

All three must be set together — a partial set is silently ignored (no warning, reporting stays off). Posting happens only in the --service loop; the prove subcommand builds the same configuration but never posts. See Ethproofs prover for the posting lifecycle.

Inert flags

Accepted, parsed, and currently doing nothing:

FlagTypeDefaultStatus
--post-everyintegerunsetReserved posting interval; computed in the service loop but never acted on.
--pk-pathpathpk.binProving key path; unused — the proving key is generated in-process at startup.

Subcommands

fetch

Fetch a block and its witness over RPC and write the flat bundle to <data-dir>/blocks/<N>/flatWitnessBundle<N>.mfbd.

z6m_prover fetch --rpc-url <url> [--block-number <N>] [--data-dir <dir>] [--save-all-responses] [--geth]
FlagTypeDefaultDescription
--rpc-urlstringtop-level --rpc-urlRPC endpoint URL. Required (here or top-level).
--block-numberintegerlatestBlock to fetch; unset or 0 means the latest chain head.
--data-dirpathtop-level --data-dirOutput root directory.
--save-all-responsesbooloffAlso save the raw RPC JSON next to the bundle (ORed with the top-level flag).
--gethbooloffUse geth's debug_executionWitness format instead of reth/alloy.

On success prints Fetched block <N> into <dir>. Notes:

  • fetch reuses a cached bundle if one already exists on disk; service mode force-rebuilds on every block.
  • --geth exists only here. Service mode always fetches in reth/alloy format — there is no way to run the service against a geth node's witness format.

execute

Execute the guest program for one block in the zkVM without proving. Always runs on the CPU executor, regardless of SP1_PROVER.

z6m_prover execute --block-number <N> [--data-dir <dir>] [--file-name <path>] [--is-test]
FlagTypeDefaultDescription
--block-numberinteger0Block to execute; input read from <data-dir>/blocks/<N>/flatWitnessBundle<N>.mfbd (or ethTests<N>.json with --is-test). Required (> 0) unless --file-name is set.
--file-namepathExplicit input file path, overriding block-number resolution.
--is-testbooloffTreat the input as an ethereum/tests JSON fixture instead of an .mfbd bundle.
--data-dirpathtop-level --data-dirRoot data directory.

Success prints Executed block <N> (gas_used=..., cycles=..., prover_gas=..., syscall_count=...) and appends a line to <data-dir>/executionLogs.log. Failure (gas_used=0) prints FAILED block ... and exits with status 1.

prove

Generate a proof for one block.

z6m_prover prove --block-number <N> [--data-dir <dir>] [--file-name <path>] [--is-test]
FlagTypeDefaultDescription
--block-numberinteger0Block to prove; same input resolution as execute. Required (> 0) unless --file-name is set.
--file-namepathExplicit input file path.
--is-testbooloffTreat the input as an ethereum/tests JSON fixture.
--data-dirpathtop-level --data-dirRoot data directory.
--pk-pathpathpk.binInert. The key is generated in-process.
--proof-pathpathInert. See below.
--proof-typestringcompressedInert here. Honored only by service-mode proving.

Known quirks of the current implementation — verify against your build if these matter to you:

  • The proof is generated in compressed mode via the CUDA prover, unconditionally. --proof-type and SP1_PROVER are both ignored by this subcommand. A key-setup failure (e.g. no CUDA proving server) prints an error but still exits 0, and a proving failure is discarded silently — the exit status does not reflect whether proving succeeded.
  • The proof stays in memory and is never written to disk. --proof-path is accepted but unused, and the closing summary line reports placeholder values (gas_used=0, empty proof path). Use service mode for persisted proofs.
  • Ethproofs flags are accepted and validated on this path, but no posting ever happens outside --service.

setup

z6m_prover setup [--pk-path pk.bin] [--vk-path vk.bin]

Currently a no-op: the handler body is commented out and nothing is written. Keys are generated in-process whenever proving starts.

verify

z6m_prover verify [--proof-path proof.bin] [--vk-path vk.bin]

Currently a no-op: the handler body is commented out and no verification runs.

Environment variables

dotenv runs at startup, so all of these can be placed in a .env file in the working directory (see .env.example in the repo root).

VariableEffect
SP1_PROVERSelects the proving backend for service-mode proving. Only the value cuda is special-cased (builds the local GPU prover via sp1-gpu-server); any other value — mock, cpu, network, or unset — yields the in-process CPU prover. The mock and network modes listed in .env.example are not currently wired up (the SDK's from_env client is disabled in code). Ignored by execute (always CPU) and by the one-shot prove (always CUDA).
NETWORK_PRIVATE_KEYListed in .env.example for the Succinct Prover Network; inert while network mode is not wired up.
RUST_LOGStandard tracing filter for log verbosity; defaults to warn when unset.

The Ethproofs settings are flags only — there are no ETHPROOFS_* environment variables read by the binary.

Where to go next