feat(badges): surface the per-RP gating nullifier + branded type + drift gate (crypto-core M5)#13
Merged
Conversation
Member
Author
|
Audit resolution (crypto-core Phase 4 SDK). Resolved every SDK-side finding:
Verify: |
AtHeartEngineer
changed the base branch from
feat/crypto-core-phase1-badge-schema
to
main
July 5, 2026 04:42
…ift gate Surface the crypto-core Phase 4 per-RP Sybil nullifier through the SDK: add the branded `MinisterGatingNullifier` type, strip and format-check the VC `credentialSubject.nullifier` in verify-badge before the strict parse, surface it on account-age and social-following, add the `@ministryofmany/ nullifier` derive package, and add the two-sided badge drift gate. Rebased onto main; dist regenerated from source on main's tsup toolchain.
AtHeartEngineer
force-pushed
the
feat/crypto-core-phase4-sdk-nullifier
branch
from
July 5, 2026 04:47
0f8ed3d to
68efd87
Compare
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.
The SDK half of crypto-core Phase 4 (M5): the RP-facing verification surface for the per-RP Sybil-dedup nullifier Minister now binds into the signed VC.
Stacked on
feat/crypto-core-phase1-badge-schema(the Phase 1 badge-schema branch is not yet onmain); this PR's base is that branch so the diff is Phase 4 only.What changed
MinisterGatingNullifier(mnv1:...) — non-interchangeable at compile time with@ministryofmany/nullifier's Poseidon/BN254 string. Two permanently distinct primitives (credential-anchored VOPRF+HMAC gating tag vs account-anchored, circuit-usable Poseidon); no conversion.verify-badgestripsnullifieras a third reserved key BEFOREschema.parse, so strict per-type schemas (account-age,social-following,tlsn-attestation) stay strict. Format-checks^mnv1:[A-Za-z0-9_-]+$(fail closed on malformed) and surfacesnullifier?: MinisterGatingNullifieronVerifiedBadge. Absent ⇒undefined(ref-less / pre-M5) — unchanged behavior for badges with no nullifier.sub), the two-primitives table (M3), and the "one credential, not one person" honesty tied to per-typesybilResistance.drift.test.ts— the long-planned cross-package drift gate: pins this registry (slug set,credentialType,sybilResistance, schema shape/strictness) against a frozen transcription of@ministryofmany/shared.dist/committed (nopreparescript).Verification
pnpm exec tsc --noEmitOKpnpm exec vitest runOK: 474 passed across the repo; the M5 additions areverify-badge(20, incl. strict account-age/social-following expose-the-value + malformed fail-closed) anddrift(61).pnpm run buildOK,dist/regenerated and committed.Discreetly compatibility (not repinned in this PR — confirmed)
Discreetly's server verifier (
@ministryofmany/minister-verify) delegates to this SDK'sverifyMinisterBadge, so it inherits the nullifier strip/surface automatically. Both Discreetly mock issuers emit nonullifierclaim, so badges verify withnullifier: undefinedand strict schemas are unaffected.@ministryofmany/clientis consumed vialink:; no repin needed.