antouhou / rs-merkle

The most advanced Merkle tree library for Rust
MIT License
168 stars 45 forks source link

Algorithm/function to update the leaf nodes in the MerkleTree #26

Open AlvinKuruvilla opened 1 year ago

AlvinKuruvilla commented 1 year ago

First off I want to thank you for making this crate. I had one potential suggestion to improve the crate. I feel that it would be useful to have a helper function that enables a leaf node in a given tree to be updated. I tried looking in the documentation to see if such functionality already existed but I couldn't find anything. My current workaround for this issue is to update the set of leaves and create an entirely new MerkleTree from there, however, this is very wasteful especially when dealing with large leaf counts. Do you have any suggestions for a better way to do something like this, or if a function could be designed to do this?

antouhou commented 1 year ago

Hey @AlvinKuruvilla ! Yeah, I was thinking about something like this, just never had the time to add such functionality. I have somewhat limited availability right now, but would look into it a bit later, thanks!

AlvinKuruvilla commented 1 year ago

Of course, thanks for getting back to me. If you could give me some direction on how you would go about implementing a feature like this, I could try writing a PR for it

Pompey21 commented 1 year ago

+1: having this feature would be absolutely amazing!!