Open nrryuya opened 5 years ago
Bryant's suggestion.
https://github.com/ethereum/vyper/issues/806#issuecomment-451665063
I think both of those implementations have different optimizations that they make... Hard to say what the core algorithm should be, but not sure how we capture optimizations.
Note that OpenZeppelin example assumes a sorted tree, which is a non-standard optimization that makes an assumption for how the keypath should be processed. A more general algorithm should not make this assumption. I believe it is a general, non-sparse merkle tree not commonly used for Plasma proofs.
Note that Loom's implementation has an optimization including an additional data structure that declares whether a given sibling corresponds to a null subtree (allowing the compression of the branch to exclude pre-defined null nodes)
loom Plasma Cash SMT
OpenZeppelin