Skip to content

Latest commit

 

History

History
21 lines (11 loc) · 991 Bytes

File metadata and controls

21 lines (11 loc) · 991 Bytes

Merkle Tree

This directory contains an implementation for the Merkle Tree data structure.

Components

We define a Transaction class as an abstraction of a general transaction.

For the tree, we define a TreeNode class that holds some data, its hash, its child nodes and parent node.

The main class is the MerkleTree that receives a list of transactions and builds the tree. This class provides a method to produce a proof that a transaction belongs to the list of transactions.

The proof is an object of the class MerkleProof that contains hash operations to be performed in order to reach the Merkle tree's root hash.

Usage

To check out how it can be used, check out the merkle_tree_usage.ipynb file.

Complexity test

A complexity test on the size of the proof is performed in the merkle_tree_complexity_test.ipynb file.