Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added serialize and deserialize to starky proofs #1630

Merged
merged 8 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions starky/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ anyhow = { workspace = true }
hashbrown = { workspace = true }
itertools = { workspace = true }
log = { workspace = true }
serde = { workspace = true, features = ["rc"] }
num-bigint = { version = "0.4.3", default-features = false }

# Local dependencies
Expand Down
10 changes: 7 additions & 3 deletions starky/src/proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ use plonky2::iop::target::Target;
use plonky2::plonk::config::{GenericConfig, Hasher};
use plonky2::util::serialization::{Buffer, IoResult, Read, Write};
use plonky2_maybe_rayon::*;
use serde::{Deserialize, Serialize};

use crate::config::StarkConfig;
use crate::lookup::GrandProductChallengeSet;

/// Merkle caps and openings that form the proof of a single STARK.
#[derive(Debug, Clone)]
#[derive(Serialize, Deserialize, Debug, Clone)]
#[serde(bound = "")]
pub struct StarkProof<F: RichField + Extendable<D>, C: GenericConfig<D, F = F>, const D: usize> {
/// Merkle cap of LDEs of trace values.
pub trace_cap: MerkleCap<F, C::Hasher>,
Expand Down Expand Up @@ -120,7 +122,8 @@ impl<const D: usize> StarkProofTarget<D> {
}

/// Merkle caps and openings that form the proof of a single STARK, along with its public inputs.
#[derive(Debug, Clone)]
#[derive(Serialize, Deserialize, Debug, Clone)]
#[serde(bound = "")]
pub struct StarkProofWithPublicInputs<
F: RichField + Extendable<D>,
C: GenericConfig<D, F = F>,
Expand Down Expand Up @@ -217,7 +220,8 @@ pub struct MultiProofChallenges<F: RichField + Extendable<D>, const D: usize, co
}

/// Purported values of each polynomial at the challenge point.
#[derive(Debug, Clone)]
#[derive(Serialize, Deserialize, Debug, Clone)]
#[serde(bound = "")]
pub struct StarkOpeningSet<F: RichField + Extendable<D>, const D: usize> {
/// Openings of trace polynomials at `zeta`.
pub local_values: Vec<F::Extension>,
Expand Down
Loading