Architecture
One Next.js app, keys only in the browser, and a few small server routes.
Your browser
Web app or extension. Keys never leave it.
- Wallet screensHome, Send, Swap, Earn, Security
- SigningBoth signatures, made here
- Sealed storeIndexedDB, opened by your passkey
signed transactions, reads
QoreChain
Checks two signatures on every transaction.
- Native sideSend, swap, stake, register key two
- EVM sideSavings vault and its factory
- PrecompilespqcVerify, pqcKeyStatus
starter funds, relayed allowance payments
Kannuki’s server
Small routes. None can move your money.
- Starter fundsTest QOR from Kannuki’s own account
- Allowance relayBroadcasts what your browser key signed
- Pairing mailboxLaptop ↔ phone, ciphertext only
- Ask and priceParsing a request, the QOR price
| Layer | What | Where |
|---|---|---|
| App | Next.js 16 (App Router). On a phone: one column with bottom tabs, flows as full pages. On a laptop: a sidebar, a dashboard Home and flows in a panel on the right. Every flow has its own URL | apps/web/src/app, src/features/*, src/components/shell/* |
| Chain | @qorechain/sdk 0.14: unified accounts, EthNativeSigner hybrid signing, message composers; REST reads with a second node as fallback | src/lib/chain/* |
| Keys | Passkey PRF → HKDF → AES-GCM seal in IndexedDB; a non-extractable browser key when there's no PRF; one submission at a time per account (Web Locks) | src/lib/keys/* |
| Data | TanStack Query: balances every 8 s, quotes every 10 s, protection until confirmed | src/lib/queries.ts |
| Contracts | Foundry: SavingsVault, VaultFactory, QorePqc (calls pqcVerify / pqcKeyStatus) | contracts/ |
Server routes (none can move your money)
| Route | Job |
|---|---|
/api/starter | Sends starter test QOR from Kannuki's own account, one queue, per-IP caps |
/api/relay | Broadcasts allowance payments your browser key signed; checks it's a capped QOR transfer naming this relayer; reports execution failures as refused |
/api/pair/[channel] | Encrypted mailbox between laptop and phone (server-sent events); ciphertext only |
/api/command | OpenAI GPT-6 Luna, strict structured output: one intent from a typed request |
/api/voice/session | A one-conversation token for the ElevenLabs agent (the key stays on the server) |
/api/rob, /api/handle, /api/price, /api/fx | Rob-me feed and comments, @handle resolution, QOR price, exchange rates |
Signing paths
- Normal:
EthNativeSignerwith the account fromunifiedAccountFromSeed(seed, { recoveryCode }); the sign-bytes form (v1/v2) is resolved per network and pinned; fees are a fixed table per message type. - Registration: classical only, with proof of possession (
MsgRegisterPQCKeyV2), as the first transaction. - Phone approval: split signing (
src/lib/chain/split-sign.ts): the phone signshybridSignBytes(B0, authInfo), this device adds the extension and the classical signature. - Refusals map to the app's availability conditions (
src/lib/chain/errors.ts), so every "can't" says why and offers the fix.