Technical Documentation
Overview of Cloak's architecture, protocols, and user flows.
Architecture
- Monorepo: pnpm + turbo + TypeScript
- apps/web — Next.js frontend (wagmi, zustand)
- services/api — Name registration and lookup
- services/resolver — CCIP-Read stealth address resolution
- services/relayer — EIP-7702 gasless transaction relay
- services/indexer — On-chain event scanning
- services/worker — BullMQ background job processing
- packages/sdk — Shared crypto and client libraries
- packages/db — Drizzle ORM + Supabase Postgres
- contracts/ — Solidity (Foundry): Hydrator, Resolver, EarnModule, GuardianModule, AttentionGate, PoolAdapter
Key Protocols
- ERC-5564 — Stealth address standard for private payments
- EIP-7702 — Authorization delegation for gasless user operations
- Safe{Core} — Smart account proxy factory with modular extensions
- CCIP-Read (EIP-3668) — Off-chain data resolution for ENS names
- ERC-4626 — Tokenized vault standard for auto-yield strategies
- XMTP — Decentralized encrypted messaging layer
User Flow
- 1. Connect wallet and claim a .hiid.eth name
- 2. Sign a message to derive spending + viewing key pair
- 3. Keys produce a 66-byte stealth meta-address stored on-chain
- 4. Senders resolve your name → resolver returns a fresh stealth Safe address each time
- 5. Funds arrive at unique, unlinkable addresses only you can control
- 6. Idle funds auto-routed to yield vaults via CloakEarnModule