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: usizeThe conjectured security level in bits. Concretely, the system
- is perfectly complete, and
- has soundness error 2^(-security_level).
fri_expansion_factor: usizeThe 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: usizeThe 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.
num_collinearity_checks: usizeThe number of collinearity checks to perform in FRI.
Implementations§
Source§impl Stark
impl Stark
Sourcepub fn new(security_level: usize, log2_of_fri_expansion_factor: usize) -> Self
pub fn new(security_level: usize, log2_of_fri_expansion_factor: usize) -> Self
§Panics
Panics if log2_of_fri_expansion_factor is zero.
Sourcepub fn prove(
&self,
claim: &Claim,
aet: &AlgebraicExecutionTrace,
) -> Result<Proof, ProvingError>
pub fn prove( &self, claim: &Claim, aet: &AlgebraicExecutionTrace, ) -> Result<Proof, ProvingError>
Sourcepub fn max_degree(&self, padded_height: usize) -> isize
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.
Sourcepub fn fri(&self, padded_height: usize) -> Result<Fri, FriSetupError>
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
impl<'a> Arbitrary<'a> for Stark
Source§fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
Self from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
Self from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Unstructured this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Unstructured this type
needs to construct itself. Read moreSource§impl<'de> Deserialize<'de> for Stark
impl<'de> Deserialize<'de> for Stark
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Copy for Stark
impl Eq for Stark
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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