celestiaorg/nmt

Proof struct is missing a function for range verification

Opened this issue · 0 comments

Proof struct does not have a function for verifying a range of leaves that do not have to belong to the same namespace.

In the nmt.go there is a function ProveRange that does not depend on namespaceID and builds a proof for a given range. However, there is no its Verify- inverse function in proof.go. All verify functions (VerifyNamespace and VerifyInclusion) in proof.go depend on the namespaceID.

Function verifyLeafHashes could be used for proving a range of leaves that do not have to belong to the same namespace if its parameter verifyCompleteness is set to false (then its parameter nID would not be used, so it could be nil). This functions is used for internal purposes (called from VerifyNamespace and VerifyInclusion), so it could be as a called from the new function for verifying proof for a given range of leaves.