triton_vm::stark

Struct Stark

Source
pub struct Stark {
    pub security_level: usize,
    pub fri_expansion_factor: usize,
    pub num_trace_randomizers: usize,
    pub num_collinearity_checks: usize,
}
Expand description

Parameters for the Zero-Knowledge Scalable Transparent ARgument of Knowledge (STARK) for Triton VM.

The two core methods are Stark::prove and Stark::verify.

Fields§

§security_level: usize

The conjectured security level in bits. Concretely, the system

  • is perfectly complete, and
  • has soundness error 2^(-security_level).
§fri_expansion_factor: usize

The ratio between the lengths of the randomized trace domain and the FRI domain. Must be a power of 2 for efficiency reasons.

§num_trace_randomizers: usize

The number of randomizers for the execution trace. The trace randomizers are integral for achieving zero-knowledge. In particular, they achieve ZK for the (DEEP) ALI part of the zk-STARK.

See also MasterTable::trace_randomizer_for_column.

§num_collinearity_checks: usize

The number of collinearity checks to perform in FRI.

Implementations§

Source§

impl Stark

Source

pub fn new(security_level: usize, log2_of_fri_expansion_factor: usize) -> Self

§Panics

Panics if log2_of_fri_expansion_factor is zero.

Source

pub fn prove( &self, claim: &Claim, aet: &AlgebraicExecutionTrace, ) -> Result<Proof, ProvingError>

Prove the correctness of the given Claim using the given witness.

This method should be the first option to consider for proving. For more control over the proving process, see Prover.

Source

pub fn verify( &self, claim: &Claim, proof: &Proof, ) -> Result<(), VerificationError>

Verify the accuracy of the given Claim, supported by the Proof.

See also Verifier.

Source

pub fn derive_max_degree(&self, padded_height: usize) -> isize

👎Deprecated since 0.43.0: use stark.max_degree instead
Source

pub fn max_degree(&self, padded_height: usize) -> isize

The upper bound to use for the maximum degree the quotients given the length of the trace and the number of trace randomizers. The degree of the quotients depends on the AIR constraints.

Source

pub fn derive_fri(&self, padded_height: usize) -> Result<Fri, FriSetupError>

👎Deprecated since 0.43.0: use stark.fri instead
Source

pub fn fri(&self, padded_height: usize) -> Result<Fri, FriSetupError>

The parameters for FRI. The length of the FRI domain has a major influence on proving time. It is influenced by the length of the execution trace and the FRI expansion factor, a security parameter.

In principle, the FRI domain length is also influenced by the AIR’s degree (see air::TARGET_DEGREE). However, by segmenting the quotient polynomial into TARGET_DEGREE-many parts, that influence is mitigated.

Trait Implementations§

Source§

impl<'a> Arbitrary<'a> for Stark

Source§

fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>

Generate an arbitrary value of Self from the given unstructured data. Read more
Source§

fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>

Generate an arbitrary value of Self from the entirety of the given unstructured data. Read more
Source§

fn size_hint(depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type needs to construct itself. Read more
Source§

impl Clone for Stark

Source§

fn clone(&self) -> Stark

Returns a copy 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 Stark

Source§

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

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

impl Default for Stark

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Stark

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Hash for Stark

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Stark

Source§

fn eq(&self, other: &Stark) -> 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 Serialize for Stark

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Copy for Stark

Source§

impl Eq for Stark

Source§

impl StructuralPartialEq for Stark

Auto Trait Implementations§

§

impl Freeze for Stark

§

impl RefUnwindSafe for Stark

§

impl Send for Stark

§

impl Sync for Stark

§

impl Unpin for Stark

§

impl UnwindSafe for Stark

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, dst: *mut T)

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

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize = _

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,