p3_fri/
proof.rs

1use alloc::vec::Vec;
2
3use p3_commit::Mmcs;
4use p3_field::Field;
5use serde::{Deserialize, Serialize};
6
7#[derive(Serialize, Deserialize, Clone)]
8#[serde(bound(
9    serialize = "Witness: Serialize, InputProof: Serialize",
10    deserialize = "Witness: Deserialize<'de>, InputProof: Deserialize<'de>"
11))]
12pub struct FriProof<F: Field, M: Mmcs<F>, Witness, InputProof> {
13    pub commit_phase_commits: Vec<M::Commitment>,
14    pub query_proofs: Vec<QueryProof<F, M, InputProof>>,
15    pub final_poly: Vec<F>,
16    pub pow_witness: Witness,
17}
18
19#[derive(Serialize, Deserialize, Clone)]
20#[serde(bound(
21    serialize = "InputProof: Serialize",
22    deserialize = "InputProof: Deserialize<'de>",
23))]
24pub struct QueryProof<F: Field, M: Mmcs<F>, InputProof> {
25    pub input_proof: InputProof,
26    /// For each commit phase commitment, this contains openings of a commit phase codeword at the
27    /// queried location, along with an opening proof.
28    pub commit_phase_openings: Vec<CommitPhaseProofStep<F, M>>,
29}
30
31#[derive(Debug, Serialize, Deserialize, Clone)]
32#[serde(bound = "")]
33pub struct CommitPhaseProofStep<F: Field, M: Mmcs<F>> {
34    /// The opening of the commit phase codeword at the sibling location.
35    // This may change to Vec<FC::Challenge> if the library is generalized to support other FRI
36    // folding arities besides 2, meaning that there can be multiple siblings.
37    pub sibling_value: F,
38
39    pub opening_proof: M::Proof,
40}