Skip to main content

miden_prover/
proving_options.rs

1use miden_core::proof::HashFunction;
2
3// PROVING OPTIONS
4// ================================================================================================
5
6/// A set of parameters specifying how Miden VM execution proofs are to be generated.
7///
8/// This struct stores the proof-generation hash function only. The actual STARK proving parameters
9/// (FRI config, security level, etc.) are determined by the hash function and hardcoded in the
10/// prover's config module.
11#[derive(Debug, Clone, Eq, PartialEq)]
12pub struct ProvingOptions {
13    hash_fn: HashFunction,
14}
15
16impl ProvingOptions {
17    // CONSTRUCTORS
18    // --------------------------------------------------------------------------------------------
19
20    /// Creates a new instance of [ProvingOptions] with the specified hash function.
21    ///
22    /// The STARK proving parameters (security level, FRI config, etc.) are determined
23    /// by the hash function and hardcoded in the prover's config module.
24    pub fn new(hash_fn: HashFunction) -> Self {
25        Self { hash_fn }
26    }
27
28    /// Creates a new instance of [ProvingOptions] targeting 96-bit security level.
29    ///
30    /// Note: The actual security parameters are hardcoded in the prover's config module.
31    /// This is a convenience constructor that is equivalent to `new(hash_fn)`.
32    pub fn with_96_bit_security(hash_fn: HashFunction) -> Self {
33        Self::new(hash_fn)
34    }
35
36    /// Returns the hash function to be used in STARK proof generation.
37    pub const fn hash_fn(&self) -> HashFunction {
38        self.hash_fn
39    }
40}
41
42impl Default for ProvingOptions {
43    fn default() -> Self {
44        Self::new(HashFunction::Blake3_256)
45    }
46}