StealthGiveStealthGive
Getting Started

Architecture

Four cleanly separated layers: a Next.js frontend, on-chain Solidity contracts, the iExec Nox TEE, and ChainGPT proxied server-side.

A working manual,

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.

Fig. i — the four strata.
plate · 01
01
stratum i
The Browser — the operator

Where donor and creator meet the protocol. Next.js 16, RainbowKit, Wagmi. No backend service in sight.

Next.js 16Wagmi 2.19RainbowKit 2.2Tailwind v4
02
stratum ii
The Server — an AI proxy

Five Next.js Route Handlers brokering ChainGPT calls. The API key never crosses the network boundary.

draft-campaigngenerate-heroaudit-contractreview-campaignimpact-report
03
stratum iii
The Chain — five contracts

Solidity contracts on Arbitrum Sepolia. They hold encrypted state, run the campaign state machine, and bind cSGD.

StealthGiveDollarConfidentialSGDFactoryCampaignRegistry
04
stratum iv
The Vault — iExec Nox TEE

The Trusted Execution Environment that does the actual confidential work. Encrypted amounts never become plaintext.

Handle GatewayNoxCompute precompileERC-7984 ops

Each stratum communicates only with its neighbour. The boundary is the privacy.

fig.
Frontend

Next.js 16 + React 19. RainbowKit + Wagmi for wallet UX. Tailwind v4 for styling, Framer Motion for animation.

fig.
Smart Contracts

Solidity 0.8.28 + Foundry. ERC-7984 confidential token deployed via iExec's wrapper.

fig.
iExec Nox TEE

Encrypted ops happen off-chain inside a Trusted Execution Environment.

fig.
ChainGPT (server)

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.

Fig. ii — a donation, in five movements.
plate · 02
  1. 01
    Sign

    Wallet signs an EIP-712 message. The gateway returns an encrypted handle.

  2. 02
    Encrypt

    Amount + RSA pubkey are sealed locally. Plaintext never leaves the browser.

  3. 03
    Operate

    Tx 1 — donor grants the campaign a transient operator permission.

  4. 04
    Donate

    Tx 2 — campaign accepts the handle, folds it into its encrypted total.

  5. 05
    Reveal

    allowPublicDecryption opens the new aggregate. The single amount stays private.

Two transactions, one signature, no plaintext.

Tech Stack

── text ──
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)