Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For true non-membership, verify_proof returns false instead of true #58

Open
0xDatapunk opened this issue Oct 7, 2024 · 1 comment
Open
Labels
audit 🔍 This issue is related to an audit. question ❔ Further information is requested

Comments

@0xDatapunk
Copy link

in smt, to prove non-membership of a key without matching_entry, should I expect the verify function to return false or true?

pub fn verify_proof(&self, merkle_proof: MerkleProof) -> bool {

As an example, let's start with a tree with [0101,'a'], [0111,'b']. assuming hash is concatenation, and we want to proof 1111, create_proof gives:
MerkleProof {
entry_response: EntryResponse {
entry: vec![Node::Str("1111".to_string())],
matching_entry: None,
siblings: vec![Node::Str("0101,a,1,0111,b,1".to_string())],
},
root: Node::Str("0101,a,1,0111,b,1".to_string()),
membership: false,
}

Now verify_proof, would use zero node to produce a root Node::Str("0101,a,1,0111,b,1,0".to_string()), so verify_proof returns false.
My understanding is we should expect true, since the MerkleProof says membership is false

@cedoor cedoor added the audit 🔍 This issue is related to an audit. label Oct 14, 2024
@cedoor
Copy link
Member

cedoor commented Oct 14, 2024

cc @waddaboo

@cedoor cedoor added the question ❔ Further information is requested label Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
audit 🔍 This issue is related to an audit. question ❔ Further information is requested
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants