Skip to content

fix(core): normalize selfie response identifier - #313

Open
Takaros999 wants to merge 3 commits into
mainfrom
takis/normalize-selfie-identifier
Open

fix(core): normalize selfie response identifier#313
Takaros999 wants to merge 3 commits into
mainfrom
takis/normalize-selfie-identifier

Conversation

@Takaros999

@Takaros999 Takaros999 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Our current IDKit response looks like this:

{
  "protocol_version": "4.0",
  "nonce": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "action": "my-action",
  "environment": "production",
  "responses": [
    {
      "identifier": "proof_of_human", // or `face`, `passport`, `mnc` 
      "issuer_schema_id": 1,
      ...
    }
  ],
  "user_presence_completed": false
}

The field identifier: face is legacy from the days Selfie Check was used to called Face Check. This confuses a lot of developers.

⚠️ Note ⚠️: I don't consider this a breaking change because identifier is of type string and not an enum. I think it's better to do this change now and bite the bullet than wait for a major bump.

Relevant to: worldcoin/developer-portal#2160

@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
idkit-js-example Ready Ready Preview Aug 4, 2026 6:33pm

Request Review

@Takaros999
Takaros999 force-pushed the takis/normalize-selfie-identifier branch from 7fc1ec6 to e36c660 Compare July 28, 2026 01:26
@Takaros999
Takaros999 force-pushed the takis/normalize-selfie-identifier branch from e36c660 to 4d93be0 Compare July 28, 2026 01:43
@Takaros999
Takaros999 force-pushed the takis/normalize-selfie-identifier branch from 4d93be0 to be8ad61 Compare July 28, 2026 01:45
@Takaros999
Takaros999 marked this pull request as ready for review July 28, 2026 01:45

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: be8ad619d4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread rust/core/src/bridge.rs Outdated
Comment on lines +322 to +324
let normalized_identifier =
normalize_response_identifier(item.identifier.clone(), item.issuer_schema_id);
let signal_hash = context.signal_hashes.get(&normalized_identifier).cloned();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve the incoming-key signal hash fallback

When proofResponseToIDKitResult receives a schema-11 response identified as face and its public signal_hashes option is keyed by that incoming identifier, this lookup now checks only selfie, so the resulting response silently loses its signal hash; the same input worked before this commit. Check the normalized key first, but fall back to item.identifier when no normalized-key entry exists.

Useful? React with 👍 / 👎.

@igorosip0v igorosip0v left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@Takaros999 the JS native transport still returns face for legacy responses (native.ts#L517-L522, #L538-L544), while the v4 branch goes through WASM and gets the new value. Would a mini app see face and web via bridge selfie for the same wallet response?

Comment thread rust/core/src/bridge.rs
Comment on lines +224 to +227
let identifier = match self.verification_level {
VerificationLevel::Face => CredentialType::Selfie.to_string(),
verification_level => verification_level.to_string(),
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@Takaros999 ResponseItem::V3 has no verification_level field (types.rs#L702-L714), and the request still sends verification_level: "face". Does an RP verifying a legacy proof now get selfie where it used to read the 3.0 level? Is selfie accepted there, or should the mapping cover only v4 and Session?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants