Skip to content

feat(zkemail): role invitations via on-chain ZK Email proof verification#170

Open
hudsonhrh wants to merge 2 commits into
mainfrom
hudsonhrh/zk-email-role-invites
Open

feat(zkemail): role invitations via on-chain ZK Email proof verification#170
hudsonhrh wants to merge 2 commits into
mainfrom
hudsonhrh/zk-email-role-invites

Conversation

@hudsonhrh
Copy link
Copy Markdown
Member

Adds ZkEmailInvites, a per-org upgradeable module that lets an executor pre-authorize specific emails or whole domains to claim role hats via a DKIM-backed ZK Email proof verified on-chain, sponsored gaslessly through the existing PaymasterHub + PasskeyAccount flow (four claim selectors auto-whitelisted, plus a combined register+claim onboarding path). It wires into OrgDeployer/ModulesFactory/ModuleTypes and only activates once per-chain infra (verifier + DKIM registry) is set via the new setZkEmailInfrastructure; a beacon-existence gate makes a missing beacon degrade gracefully instead of reverting TypeUnknown and bricking org deploys. The ZkEmailInvites beacon is now registered in the canonical deploy helpers (DeployHelper, DeployInfrastructure). Also vendors the minimal zk-email interfaces (IVerifier, IDKIMRegistry, CommandUtils) under src/zkemail/ and includes a forge-fmt-only reformat of UpgradeEligibilitySuperAdminLockdown.s.sol. Adds 50 unit + 13 integration tests (full suite 1513 passing); deploying the actual Groth16 verifier + DKIM registry and enabling the feature on live chains is a follow-up PR.

🤖 Generated with Claude Code

hudsonhrh and others added 2 commits May 28, 2026 15:27
Add ZkEmailInvites, a per-org upgradeable module that lets an executor
pre-authorize specific emails or whole domains to claim role hats by
submitting a DKIM-backed ZK Email proof, verified on-chain at claim time.
Claims are gasless via the existing PaymasterHub + PasskeyAccount flow
(four claim selectors auto-whitelisted), and a combined register+claim
path onboards first-time users in one sponsored UserOp.

- src/ZkEmailInvites.sol + vendored zk-email surface (IVerifier,
  IDKIMRegistry, CommandUtils) under src/zkemail/
- Wire into OrgDeployer/ModulesFactory/ModuleTypes; conditional on the
  per-chain protocol infra (verifier + DKIM registry) being set
- Beacon-existence gate so a missing ZkEmailInvites beacon degrades
  gracefully instead of bricking org deploys (TypeUnknown)
- Register the beacon in canonical deploy helpers (DeployHelper,
  DeployInfrastructure)
- 50 unit + 13 integration tests; full suite 1513 passing
- Includes forge fmt reformat of UpgradeEligibilitySuperAdminLockdown.s.sol

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…llites

Address review findings on PR #170:

- _verifyProofCommon now rejects proofs with `isCodeExist == false`
  (new AccountCodeMissing error), checked after verifyEmailProof so it
  asserts the proven value. Without an embedded account code, accountSalt
  is not a real Poseidon(emailAddress, accountCode) commitment, which both
  email-rule lookups and per-domain claim idempotency depend on.
- Register ZkEmailInvites in DeploySatelliteInfrastructure.s.sol
  (_deployImplementations + _registerContractTypes); satellites built with
  the standalone script previously left beaconRegistered() false, silently
  skipping the module even after infra was wired.
- 3 new unit tests (domain/email/combined paths reject !isCodeExist and
  confirm no state mutation on revert). Full suite: 1516 passing.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant