You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cannot be fixed by adding one element by making it even - this only seems to work if the number of leaves is small (3 in the case of the example above, making it 4)
But for a tree of say 9 elements, adding a zero node does not solve the issue
Why does murky not follow the bitcoin tree implementation?
The text was updated successfully, but these errors were encountered:
Thanks for the issue. That is how Bitcoin implements its merkle trees, but is not the only way. When murky was originally written, zero padding for odd number of leafs best matched off chain implementations I was writing.
A tree of 9 elements should definitely be coercible to match. But, either way, I will consider adding a Bitcoin style implementation. And would absolutely welcome a PR that does so.
The issue reported in https://ethereum.stackexchange.com/questions/129249/merkle-tree-not-matching-between-solidity-and-etherjs
Cannot be fixed by adding one element by making it even - this only seems to work if the number of leaves is small (3 in the case of the example above, making it 4)
But for a tree of say 9 elements, adding a zero node does not solve the issue
Why does murky not follow the bitcoin tree implementation?
The text was updated successfully, but these errors were encountered: