src.merkle

Functionality for creating a Merkle tree.

Functions

merkle_tree(values) Constructs a Merkle tree from a list of values.

Classes

MerkleNode(v1, v2) A hash tree node, pointing to a leaf value or another node.
src.merkle.merkle_tree(values)

Constructs a Merkle tree from a list of values.

All values need to support a method get_hash().

Return type:MerkleNode
class src.merkle.MerkleNode(v1, v2)

A hash tree node, pointing to a leaf value or another node.

Variables:
  • v1 – The first child of this node.
  • v2 – The second child of this node.
get_hash()

Compute the hash of this node.

Return type:bytes