Architecture
High-level view of how aZKey turns Google OAuth into private Aztec accounts using zero-knowledge proofs.
Components
- SvelteKit interface: UI for Google OAuth and account flows.
- SDK: Orchestrates OAuth, derives the deterministic
accountId = hash(sub, aud), generates ZK proofs, and interacts with Aztec. - Noir circuits: Verify the JWT signature with the provider public key, ensure the
accountIdmatches hashed claims, and expose only public inputs (account_id,session_owner_nonce,google_public_key). - Aztec account contract: Stores the immutable
account_id, mutablesession_owner, and verifies proofs on-chain.
End-to-end flow
- Authenticate: Redirect to Google; get an auth code and exchange for a JWT.
- Derive identity: Hash the JWT
subandaudto computeaccount_id. - Generate proof: Client uses Noir to prove:
- JWT signature is valid with the provider public key
account_idmatcheshash(sub, aud)- Private JWT contents never leave the client
- Deploy or recover: SDK deploys the account contract (or reuses an existing one) and sets a new
session_ownerviaset_ownerusing the proof and public inputs. - Transact: The session owner key signs Aztec transactions until rotated/recovered.
Extensibility for new providers
- Add a provider implementation with OAuth URLs, token exchange, JWT parsing, and public key retrieval.
- Reuse the same account derivation model; adjust the Noir circuit only if the signature scheme or JWT structure differs.
- Minimal on-chain changes: contract still validates the proof and enforces the stored
account_id.
Security & privacy notes
- JWT content and signatures remain private inputs to the circuit.
- Only
google_public_key,account_id, andsession_owner_nonceare public. - Session owners are ephemeral—rotate on recovery to limit exposure.