openvm_stark_backend/
circuit_api.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use async_trait::async_trait;

use crate::{
    config::StarkGenericConfig,
    prover::types::{Proof, ProofInput},
    verifier::VerificationError,
};

/// Async prover for a specific circuit using a specific Stark config.
#[async_trait]
pub trait AsyncCircuitProver<SC: StarkGenericConfig> {
    async fn prove(&self, proof_input: ProofInput<SC>) -> Proof<SC>;
}

/// Prover for a specific circuit using a specific Stark config.
pub trait CircuitProver<SC: StarkGenericConfig> {
    fn prove(&self, proof_input: ProofInput<SC>) -> Proof<SC>;
}

/// Verifier for a specific circuit using a specific Stark config.
pub trait CircuitVerifier<SC: StarkGenericConfig> {
    fn verify(&self, proof: &Proof<SC>) -> Result<(), VerificationError>;
}