{"repo":"cbergoon/merkletree","free":true,"listed":false,"github":"https://github.com/cbergoon/merkletree","clone":"git clone https://github.com/cbergoon/merkletree.git","description":"A Merkle Tree implementation written in Go.","language":"Go","stars":539,"topics":["hashtree","tree","golang","merkle-tree"],"license":"MIT","category":"dev-tools","readme_excerpt":"Merkle Tree in Golang An implementation of a Merkle Tree written in Go. A Merkle Tree is a hash tree that provides an efficient way to verify the contents of a set data are present and untampered with. At its core, a Merkle Tree is a list of items representing the data that should be verified. Each of these items is inserted into a leaf node and a tree of hashes is constructed bottom up using a hash of the nodes left and right children's hashes. This means that the root node will effictively be a hash of all other nodes (hashes) in the tree. This property allows the tree to be reproduced and thus verified by on the hash of the root node of the tree. The benefit of the tree structure is verifying any single content entry in the tree will require only nlog2(n) steps in the worst case. Documentation See the docs here. Constructions The tree can be built three ways. They produce different roots and are not interchangeable, so pick one when the tree is created. Construction Built with Notes --- --- --- Bitcoin-style (default) NewTree , NewTreeWithHashStrategy Pairs siblings in order, duplicates the last node on an odd count Sorted siblings NewTreeWithHashStrategySorted , WithSortedSiblings() Orders each pair before hashing, matching OpenZeppelin MerkleProof RFC 6962 WithRFC6962() Prefixed leaf and interior hashes, splits instead of padding The default follows Bitcoin so that roots line up with Bitcoin-style trees. Two well known properties come along with that. A level holding an ","default_branch":null,"files":null,"tree":[],"storefront":"/r/cbergoon","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/cbergoon/merkletree/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}