#[repr(C)]pub struct SealProof {Show 13 fields
pub path: Vec<[u8; 32]>,
pub indices: Vec<bool>,
pub payment_root: [u8; 32],
pub customer_reward_pool: u64,
pub merchant_reward_pool: u64,
pub total_customer_activity: u64,
pub total_merchant_activity: u64,
pub community_score: u16,
pub customer_reward_share: u16,
pub merchant_reward_share: u16,
pub weekly_active_users: u32,
pub weekly_retention_rate: u16,
pub weekly_activity_count: u32,
}
Expand description
Seal proof structure for dual merkle tree verification. Contains both the merkle proof path and the payment root being proven. Enhanced with epoch-specific data for accurate historical reward calculations.
Fields§
§path: Vec<[u8; 32]>
Seal merkle path nodes (sibling hashes)
indices: Vec<bool>
Seal direction indices (false = left, true = right)
payment_root: [u8; 32]
Payment root being proven (embedded in seal proof)
customer_reward_pool: u64
Epoch-specific reward calculation data for accurate historical calculations
merchant_reward_pool: u64
§total_customer_activity: u64
§total_merchant_activity: u64
§community_score: u16
§weekly_active_users: u32
§weekly_retention_rate: u16
§weekly_activity_count: u32
Implementations§
Source§impl SealProof
impl SealProof
Sourcepub fn new(
path: Vec<[u8; 32]>,
indices: Vec<bool>,
payment_root: [u8; 32],
customer_reward_pool: u64,
merchant_reward_pool: u64,
total_customer_activity: u64,
total_merchant_activity: u64,
community_score: u16,
customer_reward_share: u16,
merchant_reward_share: u16,
weekly_active_users: u32,
weekly_retention_rate: u16,
weekly_activity_count: u32,
) -> Self
pub fn new( path: Vec<[u8; 32]>, indices: Vec<bool>, payment_root: [u8; 32], customer_reward_pool: u64, merchant_reward_pool: u64, total_customer_activity: u64, total_merchant_activity: u64, community_score: u16, customer_reward_share: u16, merchant_reward_share: u16, weekly_active_users: u32, weekly_retention_rate: u16, weekly_activity_count: u32, ) -> Self
Create a new seal proof with path, indices, payment root, and epoch-specific data.
This constructor is required for:
- Historical reward calculations
- Production claim verification
- Accurate epoch-specific data
Use this for all production claims that require historical accuracy.
§Parameters
path
: Seal merkle path nodes (sibling hashes)indices
: Seal direction indices (false = left, true = right)payment_root
: Payment root being proven (embedded in seal proof)customer_reward_pool
: Epoch-specific customer reward poolmerchant_reward_pool
: Epoch-specific merchant reward pooltotal_customer_activity
: Epoch-specific total customer activitytotal_merchant_activity
: Epoch-specific total merchant activitycommunity_score
: Epoch-specific community scorecustomer_reward_share
: Epoch-specific customer reward sharemerchant_reward_share
: Epoch-specific merchant reward shareweekly_active_users
: Epoch-specific weekly active usersweekly_retention_rate
: Epoch-specific weekly retention rateweekly_activity_count
: Epoch-specific weekly activity count
Sourcepub fn new_for_verification(
path: Vec<[u8; 32]>,
indices: Vec<bool>,
payment_root: [u8; 32],
) -> Self
pub fn new_for_verification( path: Vec<[u8; 32]>, indices: Vec<bool>, payment_root: [u8; 32], ) -> Self
Create a new seal proof for verification purposes only.
This constructor is suitable for:
- Proof verification (merkle path validation)
- Testing and development
- Backward compatibility with existing proofs
- Client-side utility functions
⚠️ WARNING: This proof will have zero epoch data. For historical reward calculations, use oracle-generated proofs instead.
§Parameters
path
: Seal merkle path nodes (sibling hashes)indices
: Seal direction indices (false = left, true = right)payment_root
: Payment root being proven (embedded in seal proof)
§Usage
use miracle_api::prelude::SealProof;
let path = vec![[1u8; 32], [2u8; 32]];
let indices = vec![true, false];
let payment_root = [3u8; 32];
let proof = SealProof::new_for_verification(path, indices, payment_root);
// Use for proof verification only
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SealProof
impl<'de> Deserialize<'de> for SealProof
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>,
Auto Trait Implementations§
impl Freeze for SealProof
impl RefUnwindSafe for SealProof
impl Send for SealProof
impl Sync for SealProof
impl Unpin for SealProof
impl UnwindSafe for SealProof
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> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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