Struct smtree::proof::RandomSamplingProof[][src]

pub struct RandomSamplingProof<V: Clone + Default + Mergeable + ProofExtractable + Paddable + PaddingProvable> where
    V::ProofNode: Default + Eq + Clone + Mergeable + Serializable,
    V::PaddingProof: Default + Eq + Clone + Serializable
{ /* fields omitted */ }
Expand description

A random sampling proof proves that the result of random sampling is valid.

It consists of the tree index of the proved node, and the proofs of certain padding nodes, and a standard Merkle proof.

If the sampled index exists as a real leaf node (non-padding) in the tree, no padding nodes will be proved but just a standard Merkle proof for the sampled index.

If the sampled index doesn’t exist as a real leaf node (non-padding) in the tree, proofs of necessary padding nodes between the two closest neighbours of the sampled index are included in the proof, and the Merkle proof proves inclusion of the closest neighbours.

Implementations

The constructor.

Returns the Merkle proof.

Returns the index of the proof.

Returns the leaf nodes.

Set the leaf node in the proof of a single node.

Set the leaf nodes in a batched proof.

Add a leaf node in a batched proof.

Adds the proof of a new padding node.

Set the padding proofs as the input.

Trait Implementations

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

Verify the padding node proofs with the supporting Merkle proof for random sampling. For usage, before calling this method, the input Merkle proof needs to be verified.

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

The data type of the Merkle tree.

Random sampling. Returns the random sampling proof of the input index. Read more

Encode a proof in the format: tree_index || padding_num || padding_proofs || merkle_proof || leaves.

Decode input bytes (tree_index || padding_num || padding_proofs || merkle_proof || leaves) as a Padding proof.

Decode the input bytes as a Self object, using up all bytes. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.