Skip to content

feat(frontend): Enoki zkLogin (Sign in with Google)#92

Open
ewitulsk wants to merge 1 commit into
stagingfrom
claude/zk-login-sui-integration-Y7YmL
Open

feat(frontend): Enoki zkLogin (Sign in with Google)#92
ewitulsk wants to merge 1 commit into
stagingfrom
claude/zk-login-sui-integration-Y7YmL

Conversation

@ewitulsk

@ewitulsk ewitulsk commented Jun 5, 2026

Copy link
Copy Markdown
Owner

What

Integrates Enoki zkLogin so users can sign in with Google (social login) and get a Sui address without a browser-extension wallet. Enoki registers zkLogin as a Wallet-Standard wallet, so it appears in the existing ConnectModal and works with the app's current useSignAndExecuteTransaction flow unchanged — no signing code was touched.

Changes

  • Add @mysten/enoki (^1.0.8, compatible with @mysten/sui ^2.17.0).
  • src/main.tsx: new RegisterEnokiWallets component, rendered inside SuiClientProvider and above WalletProvider. Registers the Enoki Google wallet via useEffect and cleans up with unregister.
  • src/config.ts: VITE_ENOKI_API_KEY + VITE_GOOGLE_CLIENT_ID (both public, both optional).
  • frontend/README.md: documents the two new env vars.

Graceful by default

Registration no-ops when the keys aren't set or on a network Enoki doesn't support (e.g. devnet), so local dev boots with zero setup and only browser-extension wallets are offered. Set both vars (on testnet/mainnet) to enable the Google option.

To enable in an environment

  1. Create an app in the Enoki Developer Portal → copy the public API key.
  2. Create a Google OAuth 2.0 web client → copy the client id; whitelist the app origin as a redirect URI in Google and Enoki.
  3. Set VITE_ENOKI_API_KEY and VITE_GOOGLE_CLIENT_ID in the environment.

Verification

  • npm run build (tsc + vite) passes.
  • Not exercised against a live Enoki key in this PR (none provisioned); the registration path is guarded so unconfigured builds are unaffected.

Follow-up: universal gas sponsorship (not in this PR)

The end goal is gas sponsorship for all users. Enoki supports this for both zkLogin and external-wallet senders, but it needs infrastructure this PR intentionally omits because it can't be provisioned/tested here:

  • A backend sponsorship endpoint (e.g. in rust-backend/api-service) holding the Enoki private API key.
  • An Enoki portal allowlist of the protocol's move-call targets (and optionally sender addresses).
  • A unified frontend tx flow: build gasless → backend sponsors → connected wallet signs → backend executes, wrapping the current useSignAndExecuteTransaction calls. One flow serves zkLogin and extension wallets alike.

Happy to do that as the next PR once an Enoki account + private key are available.

https://claude.ai/code/session_015sQfezt6SJNd7w2bns494A


Generated by Claude Code

Register Enoki's zkLogin wallets into dapp-kit so social sign-in appears
in the existing ConnectModal and works with the app's current
useSignAndExecuteTransaction flow unchanged.

- Add @mysten/enoki dependency
- RegisterEnokiWallets component in main.tsx (inside SuiClientProvider,
  above WalletProvider); no-ops without keys or on unsupported networks
- VITE_ENOKI_API_KEY / VITE_GOOGLE_CLIENT_ID config (both public, optional)
- Document the new env vars in the frontend README

Gas sponsorship (covering both zkLogin and external-wallet users via a
backend + Enoki private key + portal allowlist) is a planned follow-up.
@vercel

vercel Bot commented Jun 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sui-options Ready Ready Preview, Comment Jun 5, 2026 3:38am

Request Review

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.

2 participants