Skip to content

Commit

Permalink
docs: document the assumptions
Browse files Browse the repository at this point in the history
  • Loading branch information
rach-id committed Jun 24, 2024
1 parent a81b748 commit a68a69f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -467,13 +467,11 @@ func (proof Proof) VerifyInclusion(h hash.Hash, nid namespace.ID, leavesWithoutN

// VerifySubtreeRootInclusion verifies that a set of subtree roots is included in
// an NMT.
// Note: This method is Celestia specific.
// It makes the following assumptions:
// Warning: This method is Celestia specific! Using it without verifying
// the following assumptions, can return unexpected errors, false positive/negatives:
// - The subtree roots are created according to the ADR-013
// https://github.com/celestiaorg/celestia-app/blob/main/docs/architecture/adr-013-non-interactive-default-rules-for-zero-padding.md
// - The tree's number of leaves is a power of two
// Using this method without making sure the above assumptions are respected
// can return invalid results.
// The subtreeWidth is also defined in ADR-013.
// More information on the algorithm used can be found in the ToLeafRanges() method docs.
func (proof Proof) VerifySubtreeRootInclusion(nth *NmtHasher, subtreeRoots [][]byte, subtreeWidth int, root []byte) (bool, error) {
Expand Down

0 comments on commit a68a69f

Please sign in to comment.