Architecture
Four cleanly separated layers: a Next.js frontend, on-chain Solidity contracts, the iExec Nox TEE, and ChainGPT proxied server-side.
edited & set
by Ezra Nahumury
System Layers
Four cleanly separated layers. The frontend never talks to the gateway directly without going through one of these primitives.
Where donor and creator meet the protocol. Next.js 16, RainbowKit, Wagmi. No backend service in sight.
Five Next.js Route Handlers brokering ChainGPT calls. The API key never crosses the network boundary.
Solidity contracts on Arbitrum Sepolia. They hold encrypted state, run the campaign state machine, and bind cSGD.
The Trusted Execution Environment that does the actual confidential work. Encrypted amounts never become plaintext.
Each stratum communicates only with its neighbour. The boundary is the privacy.
Next.js 16 + React 19. RainbowKit + Wagmi for wallet UX. Tailwind v4 for styling, Framer Motion for animation.
Solidity 0.8.28 + Foundry. ERC-7984 confidential token deployed via iExec's wrapper.
Encrypted ops happen off-chain inside a Trusted Execution Environment.
Five AI endpoints proxied through Next.js Route Handlers — API key never leaves the server.
Data Flow
A confidential donation moves through five steps. Each step happens in a different layer; the boundaries are what guarantee privacy.
- 01Sign
Wallet signs an EIP-712 message. The gateway returns an encrypted handle.
- 02Encrypt
Amount + RSA pubkey are sealed locally. Plaintext never leaves the browser.
- 03Operate
Tx 1 — donor grants the campaign a transient operator permission.
- 04Donate
Tx 2 — campaign accepts the handle, folds it into its encrypted total.
- 05Reveal
allowPublicDecryption opens the new aggregate. The single amount stays private.
Two transactions, one signature, no plaintext.
Tech Stack
Smart Contracts ┃ Solidity 0.8.28, Foundry, OpenZeppelin v5
┃ ERC-7984 (iExec Nox)
Nox SDK ┃ @iexec-nox/handle 0.1.0-beta.10
┃ @iexec-nox/nox-protocol-contracts 0.2.2
┃ @iexec-nox/nox-confidential-contracts 0.1.0
AI ┃ ChainGPT API — Web3 LLM, NFT/Image Generator,
┃ Smart Contract Auditor (5 server endpoints)
Frontend ┃ Next.js 16, React 19, Tailwind v4
┃ RainbowKit 2.2, Wagmi 2.19, Viem 2.48
Network ┃ Arbitrum Sepolia (chain id 421614)