Struct merkle::MerkleTree [] [src]

pub struct MerkleTree<D, T> {
    pub digest: D,
    pub tree: Tree<T>,
    pub height: usize,
    pub count: usize,
}

A Merkle tree is a binary tree, with values of type T at the leafs, and where every node holds the hash of the concatenation of the hashes of its children nodes.

Fields

The hashing function used by this Merkle tree

The inner binary tree

The height of the tree

The number of leaf nodes in the tree

Methods

impl<D, T> MerkleTree<D, T> where D: Digest + Clone, T: Into<Vec<u8>> + Clone
[src]

Constructs a Merkle Tree from a vector of data blocks

Returns the tree's root hash

Generate an inclusion proof for the given value. None is returned if the given value is not found in the tree.