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