Skip to content

kj-crypto/merkle-tree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Merkle Tree

Example of merkle tree implementation in python using single sha256 hashing.

Usage

Example of merkle tree usage

from merkle_tree import MerkleTree


merkle = MerkleTree([b"a", b"b", b"c"])
print("Merkle Tree", merkle, sep="\n")
print("Merkle Proof", [item.hex()[:8] for item in merkle.get_proof(1)])

with following output

Merkle Tree
['75761571']
['fb8e20fc', '355b1bbf']
['61', '62', '63']

Merkle Proof ['61', '355b1bbf']

Tests

Run python -m unittest test_merkle.py to execute tests.

About

Merkle Tree in python

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages