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

Unable to validate proof against original query with verifyProof() #118

Open
refi93 opened this issue Aug 4, 2023 · 1 comment
Open
Assignees
Labels
enhancement New feature or request

Comments

@refi93
Copy link

refi93 commented Aug 4, 2023

Describe the bug
I see that this SDK has a verifyProof() method which is supposed to verify the validity of the proof:

verifyProof(zkp: ZKProof, circuitName: CircuitId): Promise<boolean>;

This function takes as a parameter just the proof itself and the circuit id. However, I would like to not only verify the signature on the proof, but also that it's valid respective to the original request I sent to whomever produced that proof (otherwise , obviously, the credential holder could have sent me a proof for any other query and I wouldn't notice as the verifier)

The onchain verification contract seems to actually check that the proof's query matches the original proof request query hash: https://github.com/0xPolygonID/tutorial-examples/blob/6052cdff6ecdb9b0fe5a297bace7c81b1d03c95f/on-chain-verification/contracts/verifiers/ZKPVerifier.sol#L41 but I couldn't find anything similar in the JS SDK and its examples - is this actually possible with the JS SDK as of now? If so, could you please point me at the right call/example to do this verification against the original query?

@refi93 refi93 added the bug Something isn't working label Aug 4, 2023
@refi93 refi93 changed the title unable to pass original request to verifyProof Unable to validate proof against original query with verifyProof Aug 4, 2023
@refi93 refi93 changed the title Unable to validate proof against original query with verifyProof Unable to validate proof against original query with verifyProof() Aug 4, 2023
@vmidyllic
Copy link
Collaborator

for verification of protocol authorization request right now https://github.com/iden3/js-iden3-auth should be used.
We are going to support queries check also in SDK.

@vmidyllic vmidyllic reopened this Aug 4, 2023
@vmidyllic vmidyllic added enhancement New feature or request and removed bug Something isn't working labels Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants