feat: support Flamingo matching in browser WASM - #548
soamdesai-tfh wants to merge 3 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c4d3f7a696
ℹ️ 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".
|
|
||
| /// Attested Flamingo matching in preparation for zero-knowledge proof generation. | ||
| #[cfg(not(target_arch = "wasm32"))] | ||
| pub mod flamingo; |
There was a problem hiding this comment.
Route supported WASM builds through the dependency patches
When invoking the supported nix/build-wasm.sh or the WASM-shell command documented in nix/README.md, this newly ungated module selects the published Flamingo/Pontifex crates, while their required WASM RNG and clock support exists only in the temporary patches supplied by web/cargo.sh. Neither supported entry point bootstraps or applies those patches, so a fresh checkout's standard WalletKit WASM build now fails; route all documented WASM builds through the bootstrap/wrapper or make the patched dependencies part of the normal dependency setup.
AGENTS.md reference: AGENTS.md:L5-L7
Useful? React with 👍 / 👎.
WalletKit currently excludes Flamingo from WASM. This makes the existing three-way matcher callable from a browser through JavaScript/TypeScript bindings and a dedicated worker, with attestation verification and encryption kept in Rust.
--locked. No bootstrap script or local patches are required.Dependency changes are under review in worldcoin/pontifex#47 and worldcoin/flamingo#116.
Validation
Standard locked WASM check (including embedded-key configuration), release build, and JavaScript package build passed locally. Cargo.lock remained unchanged. The 2 Pontifex, 5 Flamingo, and 8 Chromium/WebKit browser tests passed against the pinned sources. Native suites passed during the initial implementation. Formatting, shell checks, and dependency-source checks passed.
Remaining integration
Live staging-enclave matching and actual iOS Safari testing have not been performed. Replace the Git pins with compatible crate releases before publishing WalletKit. This change covers the existing three-way operation; selfie enrollment, two-way matching, recovery, and World ID proof generation are separate work.
Note
High Risk
Introduces browser-facing biometric matching and verifier traffic with git-pinned crypto dependencies; mistakes in attestation pinning or error handling could affect trust boundaries.
Overview
Adds browser-callable Flamingo three-way matching by compiling attestation verification and encrypted matching in Rust/WASM, with a dedicated worker so match tokens stay off the parent page.
Rust / deps: New
walletkit-webcrate (wasm-bindgen) exportsFlamingoClient, typed errors, and opaque verified-match handles.walletkit-corenow builds theflamingomodule onwasm32(includingasync_trait(?Send)and skipping native-only unit tests). Flamingo verifier crates andpontifexmove from crates.io to pinned git revisions;deny.tomlwhitelists those sources andCargo.lockreflects the graph.JS / CI:
web/addsbuild.sh, aFlamingoWorkerRPC client, a test HTTP fixture, and Playwright coverage in Chromium and WebKit. The WASM CI job uses--locked, assertsCargo.lockis unchanged after check, builds the web package, and runsnpm test.Reviewed by Cursor Bugbot for commit 2a4b2b4. Bugbot is set up for automated code reviews on this repo. Configure here.