openvm_stark_backend/prover/
mod.rs

1//! Abstraction layer for prover implementations of multi-matrix circuits on a single machine.
2//!
3//! Provides a coordinator that implements a full prover by coordinating between host and device,
4//! where the host implementation is common and the device implementation relies on custom-specified
5//! device kernels.
6//!
7//! Currently includes full prover implementations for:
8//! - CPU
9
10/// Host prover implementation that uses custom device kernels
11pub mod coordinator;
12/// CPU implementation of proving backend
13pub mod cpu;
14pub mod hal;
15/// Types used by the prover
16pub mod types;
17
18/// Testing helper
19pub mod helper; // [jpw]: maybe this should be moved to sdk
20/// Metrics about trace and other statistics related to prover performance
21pub mod metrics;
22
23/// Trait for STARK/SNARK proving at the highest abstraction level.
24pub trait Prover {
25    type ProvingKeyView<'a>
26    where
27        Self: 'a;
28    type ProvingContext<'a>
29    where
30        Self: 'a;
31    type Proof;
32
33    /// The prover should own the challenger, whose state mutates during proving.
34    fn prove<'a>(
35        &'a mut self,
36        pk: Self::ProvingKeyView<'a>,
37        ctx: Self::ProvingContext<'a>,
38    ) -> Self::Proof;
39}
40
41pub type MultiTraceStarkProver<SC> =
42    coordinator::Coordinator<SC, cpu::CpuBackend<SC>, cpu::CpuDevice<SC>>;