celestiaorg / celestiaorg/nmt

Proof struct is missing a function for range verification

Open
#154 0 comments 0 reactions 0 assignees View on GitHub
audit enhancement
Dominant language
Go
Stars
122
Forks
53
Avg merge
1d 15h
Merged PRs (30d)
5

Description

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](https://github.com/celestiaorg/nmt/blob/d993c7d69a252da4a98609fa16a87dcc52be88a6/nmt.go#L209-L209) 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](https://github.com/celestiaorg/nmt/blob/4276d172f18c87ebdd18da0cc4b758f0dd164118/proof.go#L177) 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.

Contributor guide

Open the contributing guide

Research direction

Start with ProveRange in nmt.go and the verification helpers in proof.go, especially verifyLeafHashes, VerifyNamespace, and VerifyInclusion. Trace how the existing verifiers handle namespace IDs, then add the inverse for range proofs that do not require a shared namespace. Done means proofs produced by ProveRange can be verified without a namespace ID.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cryptography
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.