Remove data leaf from fuel-merkle
BMT proofs
#501
Labels
breaking
A breaking api change
bug
Something isn't working
documentation
Improvements or additions to documentation
fuel-merkle
Related to the `fuel-merkle` crate.
Currently, Merkle proofs generated by the
fuel-merkle
binary Merkle tree include the hashed leaf data for the leaf being proven in the proof set. This means that the proof set starts with the hashed leaf data and continues with side node data until reaching the root.The
fuel-merkle-sol
verify
function expects binary Merkle tree proofs to provide a proof set that contains only the side node data, and the unhashed leaf data separately. This represents a discrepancy between the proof format thatfuel-merkle
generates and the proof format thatfuel-merkle-sol
expects.This discrepancy results from having a lack of clear specification on the format in the
fuel-specs
. To provide a definitive specification, we can defer to RFC 6962 that defines the binary Merkle tree algorithm that we already use for roots. This RFC describes "audit paths" which are analogous to the proof sets we already use. According to this RFC, audit paths do not include the leaf data for the leaf being proven. Therefore, we can adapt ourfuel-merkle
library to follow this RFC.Tasks:
prove
algorithm in thefuel-merkle
BMT to omit the leaf data from the Merkle proofs (bug: Remove leaf data from BMT proofs #502)verify
function infuel-merkle
'stest-helpers
to use the updated proof format (bug: Remove leaf data from BMT proofs #502)fuel-merkle
(bug: Remove leaf data from BMT proofs #502)fuel-merkle-sol
(chore: Update BMT data-driven proof tests fuel-merkle-sol#28)The text was updated successfully, but these errors were encountered: