Expand description
Sindri Rust SDK
A library for generating zero-knowledge proofs with Sindri.
§Overview
The main entry point of this library is the client::SindriClient
struct, which encapsulates
all methods for interacting with the Sindri API. The client handles request/response management
and includes built-in robustness features like automatic retries for transient errors.
§Quick Start
Generate your first zero-knowledge proof in just a few lines of code:
use std::collections::HashMap;
use sindri::{client::SindriClient, CircuitInfo};
let client = SindriClient::default();
// Use tags and project metadata to organize and annotate your project builds
let tags: Option<Vec<String>> = None;
let project_metadata: Option<HashMap<String, String>> = None;
let circuit = client.create_circuit_blocking(
"../cli/tests/factory/circuit.tar.gz".to_string(),
tags,
project_metadata
).unwrap();
// Use proof metadata to annotate proofs with additional information and
// pass conditional flags to control whether server-side verification is enabled
let input = r#"{"a": 1, "b": 2}"#;
let proof_metadata: Option<HashMap<String, String>> = None;
let verify: Option<bool> = None;
let proof = client.prove_circuit_blocking(
circuit.id(),
input,
proof_metadata,
verify,
None, // The default prover implementation is generally recommended
).unwrap();
§Key Features
-
Project Management: Create circuits and proofs with methods like
create_circuit
andprove_circuit
-
Collaboration: Share and reuse public circuits using
clone_circuit
-
Seamless Integration: Works with popular Rust-based DSLs and zkVMs including:
- Halo2
- Plonky2
- Jolt
- Sp1
For more detailed documentation, refer to the client::SindriClient
struct.
Modules§
- client
- The primary module for interacting with Sindri’s API.
- integrations
- vendor
Structs§
- Boojum
Circuit Info Response - BoojumCircuitInfoResponse : Response for getting Boojum circuit info.
- Circom
Circuit Info Response - CircomCircuitInfoResponse : Response for getting Circom circuit info.
- Gnark
Circuit Info Response - GnarkCircuitInfoResponse : Response for getting Gnark circuit info.
- Halo2
Circuit Info Response - Halo2CircuitInfoResponse : Response for getting Halo2 circuit info.
- Hermez
Circuit Info Response - HermezCircuitInfoResponse : Response for getting Polygon Hermez circuit info.
- Jolt
Circuit Info Response - JoltCircuitInfoResponse : Response for getting Jolt circuit info.
- Noir
Circuit Info Response - NoirCircuitInfoResponse : Response for getting Noir circuit info.
- Plonky2
Circuit Info Response - Plonky2CircuitInfoResponse : Response for getting Plonky2 circuit info.
- Proof
Info Response - ProofInfoResponse : Response for getting proof info.
- Proof
Input - A wrapper type around
InternalProofInput
that provides convenient conversions from various input formats for circuit proofs. - Snarkvm
Circuit Info Response - SnarkvmCircuitInfoResponse : Response for getting SnarkVM circuit info.
- Sp1Circuit
Info Response - Sp1CircuitInfoResponse : Response for getting SP1 circuit info.
- Team
Detail - TeamDetail : Details about a team.
Enums§
- Circuit
Info Response - CircuitInfoResponse : Response for getting circuit info.
- Circuit
Type - CircuitType : CircuitType choices CircuitType choices
- Internal
Proof Input - ProofInput : An object mapping proof input variable names to their values. Can be a raw JSON object or a string serialized as JSON or TOML.
- JobStatus
- JobStatus : JobStatus choices JobStatus choices
Traits§
- Circuit
Info - Helper trait to extract common fields from CircuitInfoResponse
- Proof
Info