Trait InclusionProvable

Source
pub trait InclusionProvable {
    type ProofNodeType;
    type TreeStruct;

    // Required methods
    fn generate_inclusion_proof(
        tree: &Self::TreeStruct,
        list: &[TreeIndex],
    ) -> Option<Self>
       where Self: Sized;
    fn verify_inclusion_proof(
        &self,
        leaves: &[Self::ProofNodeType],
        root: &Self::ProofNodeType,
    ) -> bool;
}
Expand description

Trait for generating and verifying inclusion proofs.

Required Associated Types§

Source

type ProofNodeType

The data type of a node with necessary information in Merkle proofs.

Source

type TreeStruct

The data type of the Merkle tree.

Required Methods§

Source

fn generate_inclusion_proof( tree: &Self::TreeStruct, list: &[TreeIndex], ) -> Option<Self>
where Self: Sized,

Generate an inclusion proof for the input list of indexes.

Source

fn verify_inclusion_proof( &self, leaves: &[Self::ProofNodeType], root: &Self::ProofNodeType, ) -> bool

Verify the inclusion proof according to the leave nodes and the root.

Implementors§