pub struct ZkpProof {
pub data: Vec<u8>,
pub proof_type: ProofType,
pub security_level: u32,
pub metadata: ProofMetadata,
}Expand description
A zero-knowledge proof
Fields§
§data: Vec<u8>The proof data (serialized STARK proof)
proof_type: ProofTypeThe proof type
security_level: u32Security level
metadata: ProofMetadataProof-specific metadata (required for verification)
Implementations§
Source§impl ZkpProof
impl ZkpProof
Sourcepub fn from_stark_proof<C>(
proof: &Proof<C>,
metadata: ProofMetadata,
) -> Result<ZkpProof, Error>
pub fn from_stark_proof<C>( proof: &Proof<C>, metadata: ProofMetadata, ) -> Result<ZkpProof, Error>
Serialize a STARK proof into a ZkpProof with metadata
All proofs must include metadata for proper verification. This method is used internally by the high-level API functions.
Sourcepub fn to_stark_proof<C>(&self) -> Result<Proof<C>, Error>
pub fn to_stark_proof<C>(&self) -> Result<Proof<C>, Error>
Deserialize a ZkpProof into a STARK proof
Sourcepub fn merkle_tree_depth(&self) -> Option<u8>
pub fn merkle_tree_depth(&self) -> Option<u8>
Get the tree depth from Merkle inclusion proof metadata
Returns Some(depth) if this is a Merkle inclusion proof with metadata,
None otherwise.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ZkpProof
impl<'de> Deserialize<'de> for ZkpProof
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ZkpProof, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ZkpProof, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for ZkpProof
impl Serialize for ZkpProof
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for ZkpProof
impl RefUnwindSafe for ZkpProof
impl Send for ZkpProof
impl Sync for ZkpProof
impl Unpin for ZkpProof
impl UnsafeUnpin for ZkpProof
impl UnwindSafe for ZkpProof
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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 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>
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