MVP repository for turning bridged GoodDollar (G$) deposits on Base / GoodDollar L2 into non-withdrawable AI compute credits that can be spent through an AntSeed buyer proxy.
GoodDollar users may have G$ but no USDC. AntSeed sellers are paid in USDC. This bridge separates the two:
- On-chain: user deposits bridged G$ into
AntSeedCreditVault. - Credit minting: vault computes USD-denominated micro credits from an operator-configured oracle rate (
G$ per USD, 1e18 precision). - Off-chain metering: API locks, settles, or refunds credits per AI usage session.
- Treasury payment: backend spends a USDC treasury through the local AntSeed buyer proxy (
http://127.0.0.1:8377by default).
Credits are not withdrawable and are only useful for compute.
packages/contracts Hardhat Solidity AntSeedCreditVault + tests
packages/api Express TypeScript usage proxy + JSON/in-memory credit ledger
packages/web Vite React minimal quote/deposit/usage UI
docs/ Architecture, API notes, and agent/AntSeed status
npm install
npm test
npm run buildRun the API and UI locally:
cp packages/api/.env.example packages/api/.env
npm run dev -w @good-ai-compute-bridge/api
npm run dev -w @good-ai-compute-bridge/webOpen the Vite URL and use the mock deposit flow. The API defaults to ANTSEED_MODE=mock; set ANTSEED_MODE=proxy only when a local AntSeed buyer proxy is funded and running.
Core properties:
- accepts an immutable IERC20 G$ token
- mints credits in USD micro-units (
1 USD = 1_000_000) oracleRateGPerUsduses 1e18 precision (100e18= 100 G$ per USD)- optional global and per-account credit caps
- owner-controlled pause and operator allowlist
- operator
spendCreditsandrefundCreditswith refund bounded by prior operator debits - intentionally no user withdrawal or treasury-USDC withdrawal path
GET /healthGET /quote?gAmount=250GET /credits/:userIdPOST /credits/mock-deposit— dev-only ledger seeding for the MVP UIPOST /usage-sessions— lock estimated creditsGET /usage-sessions/:idPOST /usage-sessions/:id/settle— charge actual used credits and unlock the restPOST /usage-sessions/:id/refund— unlock all credits without chargePOST /antseed/mock— deterministic mock completionPOST /antseed/call— metered mock/proxy completion, based onANTSEED_MODE
docs/ARCHITECTURE.md— system architecture and flowsdocs/API.md— endpoint referencedocs/AGENT_SKILLS.md— GoodClaw skill inventory and AntSeed/AntSkill status
This is intentionally small and conservative:
- on-chain deposits cannot be withdrawn from the vault in this MVP
- off-chain ledger never stores private keys or AntSeed credentials
- AntSeed proxy URL is local by default
- operators are explicit and pausable
- refunds cannot exceed prior operator-debited credits on-chain
- the API locks credits before making a paid proxy call and refunds the lock if the proxy call throws
Production hardening still needed: real event indexing, signed usage sessions, audited oracle governance, treasury controls, rate limits, durable DB, and chain-specific deployment scripts.