Closed lalexgap closed 3 years ago
As mentioned in Slack, we would want to use a type like this when passing data to a solidity contract, for efficiency.
WitnessProof = {
witness: Hash;
nodes: Hash[];
index: number;
};
so I give a 👍 to this idea
The proof format we're using from
merkle-tools
currently encodes the path directions in the proof data. RIght now that's :but we could also get it in binary which looks like:
Instead of having a left/right property (or a boolean flag) I think our proof could just be
We can use the
index
to calculate the path which is just the path information expressed as auint
. I think this would be more efficient than accepting an array of directions or some other format?That does mean converting to and from the format for
merkle-tools
but it was pretty easy to handle that.