feat: add verifyWithSession verifier entry point for session-bound proofs#862
Open
kilianglas wants to merge 10 commits into
Open
Conversation
1 task
…uniqueness-session-binding-contracts
…hub.com:worldcoin/world-id-protocol into kilianglas/uniqueness-session-binding-contracts
This was referenced Jul 14, 2026
Dzejkop
reviewed
Jul 16, 2026
| * requires the action's most significant byte to be `0x00`, `verifySession` requires `0x02`) | ||
| * and adds `verifyWithSession` for Uniqueness Proofs bound to an existing session. | ||
| */ | ||
| interface IWorldIDVerifierV2 is IWorldIDVerifier { |
Contributor
There was a problem hiding this comment.
If we're not including it in V2 imo we should do a V3 here. Since WorldIDVerifierV2 already exists - but there were not interface changes
Dzejkop
reviewed
Jul 16, 2026
| uint64 constant credentialIssuerIdWrong = 2; | ||
|
|
||
| uint64 constant rpIdCorrect = 0x1a6ccf8f70e5de68; | ||
| uint64 constant rpIdCorrect = 0x387df34f862cd4e; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #855; contracts side of the session-binding feature (see
docs/world-id-4-specs/README.md, "Binding Uniqueness Proofs to a Session").Summary
Adds a dedicated verifier entry point for uniqueness proofs bound to an existing session. #855 makes the client emit uniqueness proofs whose
session_idpublic signal carries the session's commitment; the existingverify()pins that signal to0, so bound proofs need their own entry point — verification logic itself is unchanged (verifyProofAndSignalsalready takessessionId).IWorldIDVerifierV2 is IWorldIDVerifier(the verifier was the only versioned core contract without a versioned interface: declaresverifyWithSession(...), movesInvalidActionup from the V2 contract, and addsInvalidSessionId.WorldIDVerifierV2 is IWorldIDVerifierV2, WorldIDVerifierimplementsverifyWithSession: enforces the uniqueness action prefix (MSB0x00,InvalidAction) andsessionId != 0then delegates toverifyProofAndSignals.WorldIDVerifier,IWorldIDVerifier, and the existingverify()/verifySession()behavior untouched (V2's same-signature overrides now carry explicitoverride(IWorldIDVerifier, WorldIDVerifier)lists, as required by the added interface base).RegistryTestContext) now deploysWorldIDVerifierV2behind the proxy.Fixtures & tests
generate-solidity-fixturesgains a bound-proof section: binds the uniqueness request to the session fixture's session id (cachedrpath), asserts the deterministic nullifier is unchanged, and verifies on-chain viaverifyWithSession.sessionNonceand asessionNullifiertuple whose action carries the0x02session prefix (the previous committed fixture predated the prefix scheme). Generated with the tool fix from fix: generate session fixture via its own OPRF round #861 applied.WorldIDVerifierV2Test, where the entry point lives):verifyWithSessionhappy path, bound proof rejected byverify(), unbound proof rejected byverifyWithSession, wrong-session-id rejection, action-prefix checks (incl. fuzz), and zero-session-id rejection.crates/core/tests/generate_proof.rs) now also positively verifies the bound proof on-chain viaverifyWithSession, complementing the existingverify()-rejects assertion.