Repository navigation
feat(#96): account/email/identity — suiNS fix + identity Move foundation (phased) - #99
Merged
Merged
Conversation
suiNS .sui names live on Sui mainnet, but reverse/forward resolution ran on the app's active (testnet) client and always returned [] — so a connected wallet's name never rendered. Add a dedicated read-only mainnet suiNS client (lib/suinsClient.ts), resolve reverse + forward against it, network-scope the query keys, add useResolveSuiNSAddress for search, and stop silently swallowing RPC errors (so genuine failures retry/surface instead of caching null forever). "No name" stays a normal null → callers fall back to identicon + hex. Part of #96 (shipped first, standalone, decoupled). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The on-chain + client-lib foundation for the account/email layer (UI + OTP backend follow). No plaintext PII on-chain — only an opaque email hash + grants. Move: - New `hostit_ticket::identity`: shared `EmailRegistry` (Table<HMAC, address> for one-account-one-email; register/unregister gated on ownership, idempotent for the same owner) + attendee-minted shared `EmailGrant` (grant/revoke, user bound to ctx.sender(), forward-only revoke) + EmailGrantCreated discovery event. - `access`: `EMAIL_NS_TAG = b"hostit-email:"` (tag-FIRST so the email namespace is disjoint from the bare-self KYC/drafts namespace), `seal_approve_own_email` (owner) + `seal_approve_attendee_email` (organizer + opt-in grant, confined to the email namespace). Refines the issue's P0-B: with a tag-first namespace the owner needs a dedicated own-email policy (seal_approve_self can't match it). - tests/identity_tests.move (11 tests): uniqueness incl. E_EMAIL_TAKEN + free-on- unregister; grant/revoke ownership; the policy passes for organizer+grant and aborts on the KYC/self namespace (P0-B regression), wrong event, and wrong cap. Client-lib: - web/lib/seal.ts: EMAIL_NS_TAG, makeEmailSealId, approveOwnEmail, approveAttendeeEmail. - web/lib/identity.ts: register/unregister/grant/revoke tx constructors + EV. - config.ts: EMAIL_REGISTRY_ID + 4 identity SPONSORED_TARGETS; moveErrors identity map; sponsoredTargets test extended; roll-fresh-publish.mjs rolls EmailRegistry. Gates: sui move test 144/144 (+11) · web tsc clean · lint 0 errors · vitest 190/190. Part of #96. Needs a fresh publish + config roll before the identity fns resolve. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Server-side email layer (ships safely disabled until ops sets the secrets): - lib/emailCanonical.ts (+6 tests) — shared client/server canonicalization (case, +tag, gmail dot/googlemail folding); the single source of truth for uniqueness. lib/accountMessages.ts — the wallet personal-message formats. - lib/emailHash.ts (server-only) — HMAC-SHA256(EMAIL_HASH_PEPPER, canonical) → opaque registry key, versioned for rotation. - app/api/email/start — wallet-sig-verified OTP request (Resend), KV one-time code; /verify — code check → returns the opaque hash for register_email; /bind-google — verifies the Google id_token (JWKS) → hash (no OTP, provider- verified). All clone the sponsor defense stack (force-dynamic, body cap, per-address+IP rate limit, Turnstile) and 503 when unconfigured. - app/api/identity/profile-pointer — open GET, signed PUT (zkLogin-capable via a passed SuiClient) for the non-sensitive profile:<addr>→blobId KV pointer. - config: EMAIL_ENABLED public flag (server secrets stay out of config). Needs ops secrets to go live: RESEND_API_KEY, EMAIL_HASH_PEPPER, a verified Resend domain (EMAIL_FROM); reuses TURNSTILE_SECRET_KEY + the KV creds. Gates: tsc clean · lint 0 errors · vitest 196/196. Part of #96. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
No-secrets identity display layer (works now on the fixed suiNS): - lib/profile.ts — ProfileEnvelope + useProfile (KV pointer → Walrus, cached, degrades to null), useDisplayName (provided username → suiNS → hex; isSuiNS flag so only verified suiNS gets the ✓), useProfilePicture (uploaded avatar → seeded fallback). - components/UserAvatar.tsx — never-blank avatar (Walrus blob → address-seeded swatch via lib/data hashHue). - AddressDisplay now routes through useDisplayName: shows a provided username (no badge) or a suiNS name (verified badge) or truncated hex. Gates: tsc clean · lint 0 errors · vitest 196/196. Part of #96. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Fresh publish adding the identity module + email Seal policies. Rolls config.ts + Move.toml + Published.toml to the new ids (incl. EMAIL_REGISTRY_ID). Smoke-verified on-chain: identity register/unregister/grant/revoke + EmailRegistry/EmailGrant + access seal_approve_own_email/seal_approve_attendee_email all live. - package 0xa32a5fa219199d01c34f9f4dfa98d429b9f8fb20eebd0528fc99904994912d74 - Hub 0x97a47754… · TransferPolicy 0x954db2d6… · governance 0xfd72543e… - EmailRegistry 0x279607e4… · UpgradeCap 0xa8807e83… · deployer 0xc8567c14… Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
scripts/seal-email-smoke.ts drives the deployer (as organizer + attendee) through the real package + committee key server: - owner decrypts own email via seal_approve_own_email ✅ - organizer + EmailGrant decrypts the attendee email via seal_approve_attendee_email ✅ (P0-C: the key server resolves the owned OrganizerCap + shared Event/EmailGrant dry-run) - organizer + grant is DENIED the bare-self (KYC/drafts) namespace ✅ (P0-B) De-risks the whole opt-in-disclosure design before building the UI on top. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The user-facing binding integration on the live registry:
- lib/emailBinding.ts — orchestration: useSignPersonalMessage (wallet/zkLogin),
encryptEmailEnvelope (Seal under EMAIL_NS_TAG → {id,ct} on Walrus),
decryptOwnEmail / decryptAttendeeEmail, bindGoogleEmail (popup-free),
startWalletEmail/verifyWalletEmail (OTP), eraseEmail, writeProfilePointer.
- components/EmailCaptureDialog.tsx — ProfileGate island (opens once per address
when EMAIL_ENABLED + connected + unbound; dismissible) + the dialog: Google
auto-binds the verified JWT email; wallet does email → 6-digit code → verify.
Mounted in app/(app)/layout.tsx.
Each bind: Seal-encrypt the email for the owner, register the opaque hash on
chain (sponsored), write the profile pointer (signed). No-ops until EMAIL_ENABLED.
Gates: tsc clean · lint 0 errors · vitest 196/196. Part of #96.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
In BuyTicketDialog's review step, when the buyer has a bound email + EMAIL_ENABLED, an unchecked "share my email with this event's organizer" checkbox. On a successful mint it fires grant_email_access(event) (sponsored, best-effort — never fails the purchase), creating the EmailGrant the organizer's seal_approve_attendee_email reads. Also stores the opaque email hash in the profile envelope so erase/disconnect can unregister without re-deriving it. Gates: tsc clean · lint 0 errors · vitest 196. Part of #96. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Completes the account/identity UI: - SettingsScreen: "Email" tab — reveal (decrypt own email via seal_approve_own_email), Disconnect (wallet) / locked-for-Google with "Delete my email data" for all (unregister + clear profile + Google suppress-rebind tombstone). "Public profile" editor — provided username + avatar upload → Walrus profile envelope (signed pointer), surfaced by useDisplayName/UserAvatar. - EventManageScreen: AttendeeEmailsCard — lists attendees who opted in (EmailGrantCreated), one SessionKey, decrypts each via seal_approve_attendee_email (the organizer payoff; P0-C-verified). Degrades to "(revoked/unavailable)" per row. #96 now code-complete across all v1 requirements (KYC deferred to v2). Gates: tsc clean · lint 0 errors · vitest 196/196. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- AttendeeEmailsCard: "Export CSV" of the decrypted opted-in {address,email}
(client-side download; only successfully-decrypted rows).
- CreateEventScreen: publishing now requires a bound email (app-layer only —
on-chain create_event stays permissionless). Resolves the issue's open
decision #1 toward "required for organizers at create": the Publish button
becomes "Add email to publish" (opens the bind dialog) until an email is set.
Gates: tsc clean · lint 0 errors · vitest 196/196. Part of #96.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- app/api/identity/lookup-email — HMACs the email + devInspects identity::owner_of → the registered wallet (rate-limited + Turnstile; null when unregistered). - DoorScreen AdmitPanel: "Will-call — find by email" → resolves the wallet → getOwnedObjects for a ticket on THIS event → fills the ticket id + reports status. The holder still submits the check-in with their own wallet (the ticket is owned), so this is verification + auto-fill, not a staff override. Gates: tsc clean · lint 0 errors · vitest 196/196. Part of #96. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
dadadave80
marked this pull request as ready for review
June 21, 2026 19:02
…ation True staff-side will-call check-in, the design from the deep-dive: - event: `allow_organizer_checkin` flag (opt-in, default off) + setter/reader; `record_checkin` now owns the distinct-ticket count via a `checked_in_tickets` set, so voucher / self / organizer check-ins all count consistently (checkin.move drops its ticket-status-based counter). - checkin::organizer_check_in(cap, event, ticket_id, attendee, clock) — cap-gated, window-checked, records Event-side attendance + CheckedIn WITHOUT the attendee's owned ticket (so it's one-sided → gated on the opt-in). Doesn't flip ticket status. - poap::claim_poap reconciled: accepts ticket status OR Event-side attendance, so organizer-checked-in holders can still claim a POAP. - +4 Move tests (marks attendance + count, disabled abort, wrong-cap abort, POAP-claim-after-organizer-checkin). 148/148. Frontend: organizerCheckInTx + setAllowOrganizerCheckinTx; SPONSORED_TARGETS + moveErrors(checkin 9); manage DoorPrep "Organizer email check-in" toggle + a "Check in by email" card (email → lookup → ticket → organizer_check_in) shown in the Doors-Open deck when enabled. Needs a fresh publish before it's live (new Event field + fns); batches into the next deploy. tsc clean · lint 0 errors · vitest 196/196. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
dadadave80
added a commit
that referenced
this pull request
Jun 21, 2026
chore(deploy): roll prod to fresh publish #99 (organizer check-in)
This branch was successfully deployed
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.
Implements #96 (account / email / identity layer). Draft — landing in phases. Foundation + the standalone suiNS fix are done and green; the OTP backend + UI + the gated fresh publish follow.
Done in this PR so far
✅ suiNS display fix (standalone, mergeable now — commit 1)
Root cause confirmed: names were resolved on the app's testnet client, but
.suinames live on mainnet → reverse always returned[]. Fix: a dedicated read-only mainnet suiNS client (web/lib/suinsClient.ts), reverse + new forward resolution against it, network-scoped cache keys,useResolveSuiNSAddressfor search, and no more silent error-swallowing. "No name" stays a normalnull→ callers fall back to identicon + hex. (This commit is independently shippable if you want to fast-track it.)✅ Move identity foundation + Seal email policies (commit 2)
hostit_ticket::identity: sharedEmailRegistry(Table<HMAC, address>— one-account-one-email, register/unregister gated on ownership, idempotent same-owner) + attendee-minted sharedEmailGrant(user bound toctx.sender(), forward-only revoke).access:EMAIL_NS_TAG(tag-first so the email namespace is disjoint from the bare-self KYC/drafts namespace),seal_approve_own_email(owner) +seal_approve_attendee_email(organizer + opt-in grant, confined to email).seal_approve_own_email(the issue's claim thatseal_approve_selfwould still match was incorrect — the id no longer starts with the bare address). The KYC-isolation guarantee is now by construction (disjoint prefixes) and covered by a regression test.E_EMAIL_TAKEN, free-on-unregister), grant/revoke ownership, and the policy passing for organizer+grant while aborting on the KYC/self namespace, wrong event, and wrong cap.✅ Client-lib wiring
seal.ts(makeEmailSealId,approveOwnEmail,approveAttendeeEmail),lib/identity.ts(register/unregister/grant/revoke tx constructors),config.ts(EMAIL_REGISTRY_ID+ 4 sponsored targets),moveErrorsidentity map, sponsor-targets test extended,roll-fresh-publish.mjsrolls the newEmailRegistry.Gates:
sui move test144/144 (+11) ·bunx tsc --noEmitclean ·bun run lint0 errors ·bun run test190/190.Remaining (next pushes)
app/api/email/{start,verify,bind-google}(Resend OTP + wallet-signature fusion; Google JWT re-verify) + shared serveremailHash.ts(canonicalize + HMAC-pepper) +emailCanonical.ts. Needs ops secrets:RESEND_API_KEY,EMAIL_HASH_PEPPER, and a verified Resend sending domain (reusesTURNSTILE_SECRET_KEY+ KV).useEnsureProfile()(Google auto-bind popup-free; wallet one-timeEmailCaptureDialog), Seal-encrypt → Walrus →register_email.<Avatar>+useDisplayName/useProfilePicture(suiNS name+avatar → uploaded → identicon), Settings (disconnect-for-wallet / locked-for-Google / "delete my email data" for all), buy-flow opt-in checkbox, organizer decrypt on the Redesign the per-event manage page as a lifecycle-driven command center #87 Attendees view.identitymodule + rollEMAIL_REGISTRY_ID(the identity fns/policies don't resolve on-chain until then) + P0-C empirical Seal dry-run check.See #96 for the full design, the 5 open decisions, and v1/v2 scope (KYC is v2).
🤖 Generated with Claude Code