Results & Outputs
Every .run() on a request builder (except UploadRequest::run())
returns a Result<JobHandle<T>> where T is one of the result
types. The result types are thin newtypes that carry an optional
remote JobId and Deref into their underlying *Output so all
backend accessors are reachable in one step.
Overview
Every .run() returns a Result<JobHandle<T>> where T is one of the result
types below. Awaiting the handle resolves to Result<T>.
The result types are thin newtypes over the prover backend's output
types. Each wraps an optional JobId (populated on remote runs,
None on embedded runs) and Derefs to its inner *Output so all
the backend accessors are reachable through the result without an
extra step.
Result types
Every result is a thin newtype that surfaces an identifier and
Derefs into an *Output carrying the actual data.
| Result | Identifier | Deref target |
|---|---|---|
SetupResult | job_id() -> Option<&JobId> | — |
UploadResult | job_id() -> Option<&JobId> | — |
ExecuteResult | job_id() -> Option<&JobId> | ExecuteOutput |
ProveResult | job_id() -> Option<&JobId> | ProveOutput |
VerifyConstraintsResult | job_id() -> Option<&JobId> | VerifyConstraintsOutput |
// Every Output-side method is reachable through the Deref:
let result = client.prove(&PROGRAM, stdin).run()?.await?;
result.save_proof("./proof.bin")?;
let proof: &Proof = result.get_proof();
let publics: &PublicValues = result.get_publics();
result.verify()?;
Output types
The *Output types live in zisk_prover_backend and are re-exported
at the top level of zisk_sdk. They are the direct result of a
prover run; you don't construct them — you receive them via the
Deref from the corresponding *Result.
Shared: publics access
All three output types (ProveOutput, ExecuteOutput,
VerifyConstraintsOutput) expose the same four methods for reading
the public inputs the guest committed:
| Method | Returns | Description |
|---|---|---|
get_publics() | &PublicValues | Borrow the public inputs/outputs of the run. |
get_public_values::<T>() | Result<T> | Typed deserialise via serde. |
get_public_values_abi::<T>() | Result<T> | Typed deserialise via Solidity ABI rules. |
get_public_values_slice(&mut [u8]) | () | Copy raw public-input bytes into the slice. |
The sections below cover what each output type adds on top.
ProveOutput
pub struct ProveOutput { /* ... */ }
Proof access
| Method | Returns | Description |
|---|---|---|
get_proof() | &Proof | Borrow the underlying proof. |
get_proof_bytes() | Result<Vec<u8>> | Serialised proof bytes (varies by ProofKind). |
get_proof_u64() | Result<Vec<u64>> | Serialised proof as u64 words. |
get_program_vk() | &ProgramVK | Borrow the program verification key. |
save_proof(path: impl AsRef<Path>) | Result<()> | Persist the inner Proof to path. |
Verification
| Method | Returns | Description |
|---|---|---|
verify() | Result<()> | Verify the proof against the embedded publics and program VK. |
with_publics(&PublicValues) | ZiskVerifyBuilder | Begin a verify chain with overridden publics. |
with_program_vk(&ProgramVK) | ZiskVerifyBuilder | Begin a verify chain with an overridden program VK. |
The two with_* methods return a ZiskVerifyBuilder you can keep
chaining (.with_publics(...).with_program_vk(...).verify());
verify() is the all-defaults shortcut.
Statistics
| Method | Returns | Description |
|---|---|---|
get_proving_time() | u64 | Total proving time in milliseconds. |
get_execution_steps() | u64 | Number of guest steps executed. |
get_execution_cost() | u64 | Aggregated execution cost (in cost units). |
let out = client.prove(&PROGRAM, stdin).run()?.await?;
// Save to disk
out.save_proof("./proofs/run-42.bin")?;
// Decode publics into a typed value
let digest: [u8; 32] = out.get_public_values()?;
// Verify with the publics already embedded in the proof
out.verify()?;
// Verify with an externally-held program VK
let vk = PROGRAM.vk()?;
out.with_program_vk(&vk).verify()?;
ExecuteOutput
pub struct ExecuteOutput { /* ... */ }
Carries no proof — that's the whole point of execute. Adds only a
few execution statistics on top of the shared publics surface.
Statistics
| Method | Returns | Description |
|---|---|---|
get_execution_steps() | u64 | Number of guest steps executed. |
get_execution_cost() | u64 | Aggregated execution cost (in cost units). |
get_execution_time() | u64 | Execution time in milliseconds. |
VerifyConstraintsOutput
pub struct VerifyConstraintsOutput { /* ... */ }
The constraint checker's per-run summary — not a proof object. If the constraints fail the underlying job errors out instead of returning an output, so receiving one of these means the constraints passed.
Statistics
| Method | Returns | Description |
|---|---|---|
get_execution_steps() | u64 | Number of guest steps executed. |
get_execution_total_cost() | u64 | Total cost across all constraint phases. |
get_executor_time() | &ZiskExecutorTime | Per-phase executor timing. |
get_execution_cost_per_type() | &StatsCostPerType | Per-component cost breakdown. |
get_duration() | u64 | Total constraint-check duration in milliseconds. |