feat(sdk): add Mnc preset for World ID 4.0 MNC credential#270
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
415e96a to
44e4307
Compare
44e4307 to
75a1acc
Compare
Guardiola31337
left a comment
There was a problem hiding this comment.
One question on the MNC preset path.
| }), | ||
| } | ||
| : v4CredentialType === "mnc" | ||
| ? { preset: mncPreset({ signal: widgetSignal }) } |
There was a problem hiding this comment.
Should MNC also be treated as a preset credential for the genesis-date UI? With mncPreset(), genesisIssuedAtMin is no longer included in the request.
Guardiola31337
left a comment
There was a problem hiding this comment.
One follow-up on the MNC genesis path.
| ? genesisIssuedAtMin == null | ||
| ? { preset: mncPreset({ signal: widgetSignal }) } | ||
| : { | ||
| constraints: CredentialRequest("mnc", { |
There was a problem hiding this comment.
Does this branch still need a document legacy fallback? Since it uses constraints(), the bridge params appear to fall back to verification_level: "device" again when genesis is enabled.
There was a problem hiding this comment.
you're right. For mnc + genesis we now build a v4 constraints request and explicitly keep that branch v4-only (allow_legacy_proofs=false) in the example UI. This avoids falling back to legacy verification_level=device for a document-scoped request. mncPreset() still keeps the document legacy fallback for the non-genesis path.
4e703b2 to
92b10d9
Compare
Guardiola31337
left a comment
There was a problem hiding this comment.
Thanks for addressing the feedback @Grimald 🚢
Add a dedicated Mnc preset mirroring the Passport preset pattern, so MNC requests get the correct legacy verification_level (document) and signal propagation instead of falling through the generic constraints path which defaults to device level and omits the signal.
92b10d9 to
466a65e
Compare
Guardiola31337
left a comment
There was a problem hiding this comment.
Triple-confirmed after the conflict resolution. Good to land.
Description
constraints()path in the Next.js example, which causes two issues:verification_leveldefaults to"device"instead of"document"(correct for a document credential)signalis not passed toCredentialRequest, so it's omitted from the bridge payload'sproof_requestsMncpreset mirroring the existingPassportpreset pattern.Changes
preset.rs): AddMncvariant toPresetenum with constructor,into_bridge_paramsmatch arm (usesCredentialType::Mnc,VerificationLevel::Document,allow_legacy_proofs: true), and unit testwasm_bindings.rs): AddMncPresetTypeScript interface, updatePresetunion type, addmnc()function exportwasm.ts,request.ts,index.ts): Re-exportMncPresettype, addmnc()helper function, add toIDKitnamespaceindex.ts): Re-exportmncfunction andMncPresettypeui.tsx): UsemncPreset({ signal })instead of falling through toCredentialRequestwithout signalTesting Instructions
cargo test -p idkit-core mnc_preset— verify the new test passesMncPresettype appears in generated.d.tsverification_level: "document"(not"device")proof_requests[0]includes thesignalfieldidentifier: "mnc"andissuer_schema_id: 9310are correct