A Merkle Hash Tree is a data structure with built-in verifiability. The data is stored in blocks which form the leaves of the tree. Each data block is hashed, and the level in the tree above it is formed by nodes which store the hash of the sum of the two nodes below it. Read request responses are accompanied by a list of hashes, and a client only needs to know the root hash in order to be able to verify the authenticity of data returned from the server maintaining the tree. Hash trees are used extensively in distributed systems such as cryptocurrencies and P2P file sharing applications.
Usage:
python merkleTree.py <number_of_data_blocks> && cat output.log
tested with python2.7 and python3.4