1

Do you have any ideas or suggestions how to visualize Merkle trees?

For our open source project "Open Tracking" we create Merkle trees for thousands of tracking counters before putting the root hash to a bitcoin transaction with OP_RETURN script.

Each hour we merklize state of all active counters for ~20,000 domains and thus we have the tree with 20k elements at the base level.

My first idea was to visualize it in spreadsheet-style. A first column will be level one, a second column will be level two etc.

3
  • A Merkle tree is just hashes of hashes of hashes (etc.). What benefit is there to visualizing it?
    – Nayuki
    Apr 5, 2016 at 2:43
  • From the user side, there is a reason. He needs to check if the tree is composed of elements existed in a period when a transaction has been submitted to the blockchain. So, in the interface he press on the element and sees all the hashes of all nodes of the tree with hyperlinks to files. Thus, he can download all the files, calculate independently all those hashes and check that the record he is interested in not tampered. Apr 5, 2016 at 3:56
  • Isn't just the list of files relevant in the end? The rest of the Merkle tree can be generated from them directly. Else, you could just present each file with its Merkle branch.
    – Murch
    Apr 5, 2016 at 7:32

1 Answer 1

2

You can serialize a binary tree with n leafs (such as a merkle tree) as an array of 2n-1 entries. The root is entry 1 and for each node the left child is at position 2n and the right child is at position 2n+1. This gives you a compact representation of the entire tree.

Another option would be to just have the n leaf nodes in a list since the inner nodes are actually generated from the leafs.

Both need to be checked by a program, since checking the validity of a tree involves computing cryptographic hashes. Visualizing them in a human readable format does not really provide any security if it cannot be verified.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.