Architecture & Threat Model
Dual-rail execution: public speed & Groth16 privacy.
ANGERA pairs direct non-custodial Jupiter v2 routing with the audited Cloak Groth16 ZK Shielded Pool (`zh1eLd6r…6qRkW`) and client-side `#claim` payment links — disclosing exact cryptographic guarantees and metadata boundaries on every action.
Live Execution Architecture (Public Swap Route)
1. Wallet Standard
Browser discovers Phantom / Solflare. Private keys stay strictly inside the user's wallet.
2. Server Order Proxy
GET /api/swap/order validates allowlisted mints, BigInt amounts, rate limits, and calls Jupiter v2 /order.
3. Client Byte Check & Sign
Decoded with @solana/kit, reviewed by user, signed in wallet, and verified that message bytes are unaltered.
4. Managed Settlement
POST /api/swap/execute submits to Jupiter Beam landing, then polls Solana RPC for confirmation & Explorer link.
Standard Jupiter v2 swaps execute publicly on Solana. For private transfers and swaps, ANGERA integrates the audited Cloak Groth16 ZK Shielded Pool (SOL, USDC, USDT on Mainnet) alongside client-side Fragment-Secret Claimable Payment Links (#claim=...).
Observers running Solana RPC nodes, indexers, or analytics can permanently observe every public swap:
- Your connected Solana wallet public key (signer & token account owner)
- Exact input and output token mints and settled atomic amounts
- Transaction timestamp, slot, priority fee, and DEX/RFQ liquidity venues
- Direct on-chain graph link between sender and recipient wallets
- Non-custodial: Server routes never hold user keys or sign transactions.
- Exact atomic math: All token amounts use BigInt integer parsing without float drift.
- Message integrity: Signed payloads are compared byte-for-byte against the reviewed Jupiter order message.
- Minimal telemetry: No wallet payloads, seed phrases, or private swap profiles stored in Supabase or analytics.
- Standard Jupiter swaps do not provide on-chain anonymity or unlinkability.
- RPC providers and upstream Jupiter endpoints observe network requests proxied through the Cloudflare Worker edge.
- No independent third-party security audit has been completed yet.
- Devnet Fixture mode is isolated for UI verification and does not represent live Jupiter mainnet routing.
Privacy Primitives Are Not Interchangeable
Each cryptographic technique protects a narrow surface and leaves specific leakage vectors open:
Cloak ZK Shielded Pool (SOL / USDC / USDT)
Protects: Deposits mint Poseidon commitments in an on-chain Merkle tree. Private Sends prove ownership in zero-knowledge (Groth16) while the Cloak Relay submits the withdrawal so your wallet never appears in the recipient's transaction.
Does not guarantee: Depositing 1.2345 SOL and withdrawing ~1.2345 SOL seconds later can still allow timing/amount heuristic correlation; Cloak also enforces Range risk-oracle screening and compliance viewing-key registration.
Shield-to-Shield Transfers (cloak1:...)
Protects: Moves shielded notes between Cloak vaults with 0 protocol fee, zero public token transfer amount, and X25519 CLKD1 encrypted note delivery.
Does not guarantee: Both sender and recipient must use Cloak-compatible vaults; relay observes request IP unless routed over VPN/Tor.
Shielded Swaps (swapWithChange)
Protects: Spends shielded SOL from your vault into an isolated SwapState PDA that routes through Jupiter and delivers any SPL / Token-2022 asset to a target wallet without linking back to your deposit wallet.
Does not guarantee: Currently takes shielded SOL as input principal; output token delivery to the target recipient ATA is visible on-chain from the SwapState PDA.
Secret Claimable Payment Links (#claim=...)
Protects: Stores a 32-byte ephemeral vault seed exclusively in the URL #fragment (never sent to any HTTP server) and lets any recipient claim SOL/USDC/USDT with zero gas in their wallet.
Does not guarantee: If funded directly from a public wallet, an observer who knows the vault address can see who funded it. Fund the link from your Cloak Shielded Vault for full sender-to-recipient unlinkability.
