Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

Remove statement fields from Merkle proofs #129

Merged
merged 1 commit into from
Feb 23, 2021

Conversation

adlerjohn
Copy link
Member

@adlerjohn adlerjohn commented Feb 19, 2021

Fixes #67. Does not address #48.

Removes "statement" (i.e. what you're trying to prove) fields from Merkle proof structs. Also clarify ordering of hashes. Leaf-to-root order was chosen to conform to https://tools.ietf.org/html/rfc6962#section-2.1.1.

Thanks to @fubuloubu for the discussion that led to this clarification (https://twitter.com/jadler0/status/1362432558382936067).

@adlerjohn adlerjohn added the bug Something isn't working label Feb 19, 2021
@adlerjohn adlerjohn self-assigned this Feb 19, 2021
Copy link
Member

@liamsi liamsi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All for removing the "statements" from the proof.

I'm also OK with explicitly stating the order of hashes but from @musalbas comment on discord he actually prefers to start from the root.

Maybe break out the uncontroversial changes (removing the statements) to get them merged quicker?

@musalbas
Copy link
Member

Since the NebulousLabs library starts from the leaf, I'm ok with starting from the leaf and being consistent there for all Merkle tees.

Copy link
Member

@liamsi liamsi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

| --------------- | -------------------------------- | --------------------------------------------------------------- |
| `siblingValues` | [HashDigest](#hashdigest)`[]` | Sibling hash values, ordered starting from the leaf's neighbor. |
| `siblingMins` | [NamespaceID](#type-aliases)`[]` | Sibling min namespace IDs. |
| `siblingMaxes` | [NamespaceID](#type-aliases)`[]` | Sibling max namespace IDs. |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NamespaceMerkleTreeInclusionProof is the inclusion proof for a single node right? Isn't siblingMins and Maxes implicitly included in siblingValues?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's only for the inclusion of a single leaf. The min and max sibling values are committed to in the hashes, but they're not known to a verifier. So they still need to be provided.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
3 participants