paragonie/blakechain

merkle tree?

Closed this issue · 1 comments

Hi! Is there a particular reason why you don't use a merkle tree for summary hashes? Generally they allow quick append of a summary hash rather than having to run through the whole chain to build up the new summary state.

I'm here after looking at chronicle... which is an interesting project.

A tree is great for distributed systems where data may evaporate.

However, if we chose a Merkle tree, we would need to rehash at least half of the tree on each insert to get the new Merkle root. This is partly true because, rather than a naive Merkle tree like Bitcoin uses, we would be using domain separation for leaf nodes. See zcash/zcash#501 (comment) for a discussion.

Because we cache the state before finalizing, we can simply append data for quick writes. The chaining structure allows for fast writes.