Skip to content

Georgexxe/proofpanda

Repository files navigation

ProofPanda

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.

What is implemented

  • 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.

Run locally

Prerequisites: Node.js 20.9+ and pnpm.

pnpm install
copy .env.example .env.local
pnpm dev

Open http://localhost:3000. PROOFPANDA_MODE=demo works without a wallet or network credentials.

Useful checks:

pnpm typecheck
pnpm test
pnpm smoke
pnpm build

Prove the memory loop in 20 seconds

  1. Choose Unlimited approval and run it. The unknown spender is DANGER.
  2. Click I recognize this spender — remember it.
  3. Run the exact same request again. The result softens to CAUTION and 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.

Live 0G testnet mode

  1. Add a funded Galileo wallet private key to .env.local as OG_PRIVATE_KEY.
  2. Review the endpoints and provider in .env.example.
  3. Fund Compute once with pnpm fund.
  4. Set PROOFPANDA_MODE=live and 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"]
Loading

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.

Security posture

  • 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.

Project map

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

Deliberate cuts

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.

About

ProofPanda - your ownable AI wallet guardian for every signature. Memory-aware SAFE/CAUTION/DANGER verdicts with a verifiable proof trail, powered by 0G Compute, Storage, and Chain.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors