Proof

Struct Proof 

Source
pub struct Proof {
    pub context: Context,
    pub num_unique_queries: u8,
    pub commitments: Commitments,
    pub trace_queries: Vec<Queries>,
    pub constraint_queries: Queries,
    pub ood_frame: OodFrame,
    pub fri_proof: FriProof,
    pub pow_nonce: u64,
}
Expand description

A proof generated by Winterfell prover.

A STARK proof contains information proving that a computation was executed correctly. A proof also contains basic metadata for the computation, but neither the definition of the computation itself, nor public inputs consumed by the computation are contained in a proof.

A proof can be serialized into a sequence of bytes using to_bytes() function, and deserialized from a sequence of bytes using from_bytes() function.

To estimate soundness of a proof (in bits), security_level() function can be used.

Fields§

§context: Context

Basic metadata about the execution of the computation described by this proof.

§num_unique_queries: u8

Number of unique queries made by the verifier. This will be different from the context.options.num_queries if the same position in the domain was queried more than once.

§commitments: Commitments

Commitments made by the prover during the commit phase of the protocol.

§trace_queries: Vec<Queries>

Decommitments of extended execution trace values (for all trace segments) at position queried by the verifier.

§constraint_queries: Queries

Decommitments of constraint composition polynomial evaluations at positions queried by the verifier.

§ood_frame: OodFrame

Trace and constraint polynomial evaluations at an out-of-domain point.

§fri_proof: FriProof

Low-degree proof for a DEEP composition polynomial.

§pow_nonce: u64

Proof-of-work nonce for query seed grinding.

Implementations§

Source§

impl Proof

Source

pub fn options(&self) -> &ProofOptions

Returns STARK protocol parameters used to generate this proof.

Source

pub fn trace_info(&self) -> &TraceInfo

Returns trace info for the computation described by this proof.

Source

pub fn lde_domain_size(&self) -> usize

Returns the size of the LDE domain for the computation described by this proof.

Source

pub fn conjectured_security<H>(&self) -> ConjecturedSecurity
where H: Hasher,

Returns security level of this proof (in bits) using conjectured security.

This is the conjecture on the security of the Toy problem (Conjecture 1) in https://eprint.iacr.org/2021/582.

Source

pub fn proven_security<H>(&self) -> ProvenSecurity
where H: Hasher,

Returns security level of this proof (in bits) using proven security.

Usually, the number of queries needed for provable security is 2x - 3x higher than the number of queries needed for conjectured security at the same security level.

Source

pub fn to_bytes(&self) -> Vec<u8>

Serializes this proof into a vector of bytes.

Source

pub fn from_bytes(source: &[u8]) -> Result<Proof, DeserializationError>

Returns a STARK proof read from the specified source.

§Errors

Returns an error of a valid STARK proof could not be read from the specified source.

Source

pub fn new_dummy() -> Proof

Creates a dummy Proof for use in tests.

Trait Implementations§

Source§

impl Clone for Proof

Source§

fn clone(&self) -> Proof

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Proof

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Deserializable for Proof

Source§

fn read_from<R>(source: &mut R) -> Result<Proof, DeserializationError>
where R: ByteReader,

Reads a sequence of bytes from the provided source, attempts to deserialize these bytes into Self, and returns the result. Read more
Source§

fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>

Attempts to deserialize the provided bytes into Self and returns the result. Read more
Source§

impl PartialEq for Proof

Source§

fn eq(&self, other: &Proof) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serializable for Proof

Source§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

Serializes self into bytes and writes these bytes into the target.
Source§

fn to_bytes(&self) -> Vec<u8>

Serializes self into a vector of bytes.
Source§

fn get_size_hint(&self) -> usize

Returns an estimate of how many bytes are needed to represent self. Read more
Source§

impl Eq for Proof

Source§

impl StructuralPartialEq for Proof

Auto Trait Implementations§

§

impl Freeze for Proof

§

impl RefUnwindSafe for Proof

§

impl Send for Proof

§

impl Sync for Proof

§

impl Unpin for Proof

§

impl UnwindSafe for Proof

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.