Closed Olshansk closed 2 years ago
Q1: What was the reasoning behind a ternary tree specifically?
Our Rescue hash instantiation is 3-input-1-output. The ternary tree doesn't increase the required number of hash calls but decrease the tree depth, which enables more efficient Merkle membership proofs.
I'll delegate question 2, 3 to @zhenfeizhang or @tri-joe
Q2: I did not dive to deep into the implementation and was wondering if it followed a standard design (e.g. JMT, PMT) or other?
Technically that name is a bit of a misnomer. It is a sparse representation of an append-only Merkle tree, as the only modification it supports is push()
. @shenkeyao @bfish713 any thoughts on potentially updating the name so it doesn't clash with key-value sparse merkle trees?
Q3: What is the key-value store database engine backing this?
The records merkle tree is a cryptographic accumulator, so the exact place that the data gets stored depends on how it is being used. In most cases we only store sparse representations: either the top level digest, a sparse "frontier", or some collection of specific merkle paths.
The seahorse
keystore replays blocks to construct a sparse record merkle tree in memory, then uses that sparse tree to calculate the merkle paths it needs to store locally. The merkle paths get used to prove in zero knowledge that the records you are spending in a transaction already exist in the CAPE state.
@shenkeyao @bfish713 any thoughts on potentially updating the name so it doesn't clash with key-value sparse merkle trees?
Yeah, we should rename it. I added an issue to Seahorse
: https://github.com/EspressoSystems/seahorse/issues/229.
@chancharles92 @tri-joe Thank you very much for the very quick responses.
Going to keep researching and learning, but this definitely helped clarify things.
Closed -- seems like the discussion is resolved and action will be taken in https://github.com/EspressoSystems/seahorse/issues/229.
I've been looking (not too deeply) at the
jellyfish
andseahorse
libraries and wanted to ask for a pointer or a link to a good resource on the design & decisions around the MerkleTree and KV store.1. Choice of Ternary tree
In src/merkle_tree.rs, it says:
Q1: What was the reasoning behind a
ternary
tree specifically?2. Sparse Tree Implementation
In seahorse/src/sparse_merkle_tree.rs, a
SparseMerkleTree
was implemented.Q2: I did not dive to deep into the implementation and was wondering if it followed a standard design (e.g. JMT, PMT) or other?
3. Key-Value Storage Databse Engine
From the CAPE System Components page, I found the following:
Similarly, from another section on the same page:
Q3: What is the key-value store database engine backing this?