Your ownable AI guardian for every wallet signature. ProofPanda analyzes transaction text, signature requests, suspicious links, and scam messages, then returns a plain-language SAFE, CAUTION, or DANGER verdict with a verifiable proof trail.
The important bit: guardian memory is load-bearing. A spender stored in the user's trusted history changes the next verdict and is cited in the explanation.
- Polished Next.js 16 / React 19 dashboard with guardian customization, demo scenarios, loading and error states, verdict cards, XP, and proof receipts.
- Versioned, validated API at
POST /api/v1/analyses. - Explicit memory update API at
POST /api/v1/memory/trust. - Server-only 0G Compute, Storage, and Chain adapters.
- 0G Storage read-before-analysis and write-after-analysis memory loop in live mode.
- Deterministic demo mode with the same API contract and clearly labeled simulated receipts.
- Bounded local memory cache, request limits, stable API errors, security headers, and no client-side private key.
- Unit tests proving that memory changes the verdict.
Prerequisites: Node.js 20.9+ and pnpm.
pnpm install
copy .env.example .env.local
pnpm devOpen http://localhost:3000. PROOFPANDA_MODE=demo works without a wallet or network credentials.
Useful checks:
pnpm typecheck
pnpm test
pnpm smoke
pnpm build- Choose Unlimited approval and run it. The unknown spender is
DANGER. - Click I recognize this spender — remember it.
- Run the exact same request again. The result softens to
CAUTIONand says that trusted history lowered the risk.
The risk never becomes blindly SAFE: an unlimited approval remains dangerous authority even when the spender is familiar.
- Add a funded Galileo wallet private key to
.env.localasOG_PRIVATE_KEY. - Review the endpoints and provider in
.env.example. - Fund Compute once with
pnpm fund. - Set
PROOFPANDA_MODE=liveand start the app.
Live requests follow this path:
flowchart LR
A["Paste request"] --> B["Read guardian memory from 0G Storage"]
B --> C["Three-agent debate on 0G Compute"]
C --> D["Store proof bundle on 0G Storage"]
D --> E["Anchor root hash on 0G Chain"]
E --> F["Update memory and XP on 0G Storage"]
The Compute integration uses the current @0gfoundation/0g-compute-ts-sdk package. The official Storage package still publishes under the deprecated @0glabs/0g-ts-sdk name; that dependency is isolated in lib/server/og/storage.ts for an easy swap when its replacement is published.
The live testnet path has not been funded or executed in this workspace because no private key was provided. Demo mode, static checks, and the production build do not require one.
- 0G credentials and paid SDK calls exist only in server modules.
- Inputs are strict, schema-validated, and size-limited on both sides.
- React renders all model output as text; no raw HTML is injected.
- API errors omit stack traces, prompts, headers, and private data.
- Local memory files use a SHA-256 session key, bounded arrays, atomic writes, and owner-only file permissions.
- CSP, frame protection, content-type protection, permissions policy, and referrer policy are configured.
This MVP session ID is a demo boundary, not strong authentication. Before public multi-user deployment, replace it with wallet-signature authentication and use a shared rate-limit/session store.
app/ UI and versioned API routes
components/ Guardian dashboard and proof card
lib/contracts.ts Shared schemas and types
lib/server/ Analysis, memory, security, and 0G adapters
contracts/ Optional queryable receipt registry
scripts/ Funding and smoke checks
specs/mvp_design.md Acceptance criteria and security checkpoint
tests/ Memory and risk-engine tests
Wallet-signature authentication, calldata decoding, contract deployment, ERC-7857 minting, and image export are post-MVP work. The current build prioritizes the submission's clearest claim: 0G-backed memory visibly changes a guardian verdict.