gballet / multiproof-rs

A rust implementation of Alexey Akhunov's multiproof algorithm
Apache License 2.0
32 stars 8 forks source link

Re-constructing paths of leaves during verification #25

Open s1na opened 4 years ago

s1na commented 4 years ago

This is more related to an EE wanting to do token transfers using this multiproof algorithm. I'm not sure if it makes sense to merge it in the repo.

EE receives an array of txes which include among other things a signature from sender and the address of the recipient. The EE also receives a multiproof. In order to make sure addresses of the sender and recipient of the tx corresponds to the leaves sent in the multiproof, the EE needs to re-construct the path to those leaves when it's verifying the multiproof. Here's my attempt at how one could do this:

s1na commented 4 years ago

Added a prototype of this to the typescript version: https://github.com/ethereumjs/merkle-patricia-tree/pull/101/commits/78810c5711b2e0512079bcfc0bfdb44cca58e664