zk-protocol
Shared protocol types for composing ZK attestation requests and responses.
Any agent or service can use this crate to communicate with a ZK attestation service powered by SP1 zero-knowledge proofs.
Types
| Struct | Purpose |
|---|---|
AttestRequest |
Request a Groth16 ZK proof from the attester |
AttestResponse |
Proof, public values, and VK hash returned by the attester |
RegisterResponse |
Confirmation after registering an ELF program |
AgentResponse |
Agent endpoint response with program_id and elf_hash |
Quick start
[]
= "0.1"
use ;
// Serialize your program input
let input_bytes = serialize_input.unwrap;
// Build the request
let req = AttestRequest ;
Multi-read programs
If your zkVM program calls sp1_zkvm::io::read() multiple times,
use stdin_items instead of input_bytes. Each entry in the vec
maps to one io::read() call inside the guest program:
let req = AttestRequest ;
License
MIT