feat: verify RP signature over signed action on session seed queries#865
Closed
kilianglas wants to merge 1 commit into
Closed
feat: verify RP signature over signed action on session seed queries#865kilianglas wants to merge 1 commit into
kilianglas wants to merge 1 commit into
Conversation
kilianglas
requested review from
a team,
0xThemis,
dkales,
fabian1409 and
philsippl
as code owners
July 14, 2026 08:49
0xThemis
approved these changes
Jul 14, 2026
Contributor
Author
|
Closing in favor of a redesign. The request model refactor in #866 makes the session intent (none / existing / create) an explicit three-state field, so instead of an optional |
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.
Summary
Adds an optional
signed_actionfield toNullifierOprfRequestAuthV1and teaches the OPRF node's session module to verify the RP signature over the action-inclusive message when it is present.This is the node-side prerequisite for the create-and-bind session flow: a single RP signature over a uniqueness action authorizes both the session-seed query and the subsequent nullifier query, instead of requiring a prior session round-trip as in the bind-existing flow (#855, #862). No client sends the field yet; the client-side flow ships separately once the node fleet is deployed.
Changes
crates/primitives: new optionalsigned_actiononNullifierOprfRequestAuthV1(#[serde(default, skip_serializing_if)], same pattern assignature/wip101_data); two new auth error variants + close-frame codes (4524invalid signed action,4525signed action not allowed); serde compat tests (JSON + CBOR round-trip, missing-field default, unknown-field tolerance)services/oprf-node: session module verifies the RP signature overcompute_rp_signature_msg(..., Some(signed_action))when the field is present; validation restricts it to session-seed queries (0x01) with a nullifier-action value (MSB0x00) from EOA-backed RPs — rejected on session-action queries (0x02), on the uniqueness module, and for WIP101 contract RPs (session support there is a pre-existing TODO)services/oprf-node: new countertaceo.oprf.node.auth.session_signed_actionfor fleet-level visibility of create-and-bind seed queriescrates/proof,services/oprf-dev-client: construction sites setsigned_action: None(no behavior change)Rollout
signed_actiontoday, and requests without it are verified byte-identically to before.invalid_rp_signature— loud fail-closed, never silent acceptance.SessionOprfSeed; scope derivation does not readsigned_action).Test plan
cargo test -p world-id-oprf-node— 79 passed, incl. 8 new signed-action tests (happy path, both signature/field mismatch directions, tampered value, invalid MSB, wrong query class, wrong module, contract RP)cargo test -p world-id-primitives— 142 passed, incl. new serde compat testscargo clippy --workspace --all-targets -- -D warningsandcargo +nightly fmt --all -- --check