We Provide Refunds for x402 Payments. Wrap calls through our proxy or CLI, pay a small fee per call, get an automatic USDC refund when the API breaks its SLA on latency, availability, or schema.


**Pact-0G is the insurance layer for AI agent API calls on 0G.**
Agents that call 0G Compute today have no recourse when a provider degrades. A breached SLA still gets billed, the agent eats the loss, and nobody on-chain knows it happened. Pact fixes that.
How it works:
1. An endpoint registers on `PactCore` with a flat premium, SLO (e.g. 5s latency), and exposure cap.
2. Integrators top up a per-endpoint **coverage pool** with real USDC.e.
3. Agents call the endpoint via `market-proxy-zerog`. The proxy charges a premium per call, classifies the response against the SLO, and emits a `SettlementEvent`.
4. `settler-evm` batches events, uploads the per-call evidence blob to **0G Storage**, and submits `settleBatch` on **0G Chain**.
5. On success: the premium splits per fee config (Treasury + Affiliates + residual to pool). On breach: the agent gets refunded from the coverage pool, clamped by the hourly exposure cap.
Real USDC.e moves through the protocol. We point at the canonical [XSwap Bridged USDC](https://chainscan.0g.ai/address/0x1f3AA82227281cA364bFb3d253B0f1af1Da6473E), not a mock.
**Why it matters:** the agentic economy needs payment trust layers, not just rails. Pact gives 0G Compute consumers a money-back guarantee, makes provider reliability priceable on-chain, and lets integrators (DEXes, AI marketplaces, agent platforms) bundle insurance into their UX without writing their own claims logic.
This is a real product. The team runs the equivalent stack on Solana mainnet today at `market.pactnetwork.io`. The 0G port is product expansion, not a hackathon-only build.
**Architecture:**
- `protocol-zerog-contracts`: Solidity port of Pact's v1 Pinocchio program. 54/54 tests, 100% line + branch coverage.
- `protocol-zerog-client`: viem bindings, event decoders, error map.
- `zerog-storage-client`: typed wrapper over `@0gfoundation/0g-storage-ts-sdk`.
- `zerog-compute-client`: typed wrapper over `@0gfoundation/0g-compute-ts-sdk`.
- `market-proxy-zerog`: Hono proxy in front of 0G Compute with ECDSA auth + balance pre-check.
- `settler-evm`, `indexer-evm`, `db-zerog`: NestJS services for batched on-chain settlement and read API.
- `pact-zerog-dashboard`: Next.js dashboard, deployed at https://pact-zerog-dashboard.vercel.app.
- `samples/zerog-demo`: one-shot CLI that runs the full lifecycle end-to-end.
**0G components used (three of five):**
- **0G Chain (Aristotle 16661):** `PactCore` deployed at `0xc702c3f93f73847d93455f5bd8023329a8118b7f`.
- **0G Storage:** per-call evidence blob, rootHash embedded in every `CallSettled` event.
- **0G Compute:** insured inference calls via `market-proxy-zerog`.- **Day 0–1 (2026-05-15): ** Validated 0G stack assumptions with throwaway spikes. Foundry deploys with `cancun` on Galileo testnet, `@0gfoundation/0g-storage-ts-sdk` round-trips with deterministic rootHash, `@0gfoundation/0g-compute-ts-sdk` discovery passes. Full numbers in `spikes/RESULTS.md`.
- **Week 1–2 :** Scaffolded 9 new packages covering Solidity contracts, viem client, storage + compute typed wrappers, market-proxy, settler, indexer, dashboard. 184 files, ~21K insertions.
- **Week 3: ** Researched the canonical stablecoin on 0G mainnet. Confirmed XSwap Bridged USDC.e via Chainlink CCIP exists at `0x1f3AA82227281cA364bFb3d253B0f1af1Da6473E` (6 decimals, ~1.7M circulating supply). USDT0 explicitly doesn't support 0G yet, so the protocol is USDC-only by ecosystem constraint. Wired the deploy script to point at the real token instead of MockUsdc on mainnet.
- **Week 4: ** Deployed `PactCore` to 0G mainnet (Aristotle 16661), registered `demo-chat` endpoint, topped up the coverage pool with 0.5 USDC.e, settled a 2-call batch (1 non-breach + 1 breach with 0.01 USDC.e refund). Live mainnet evidence: [settle_batch tx](https://chainscan.0g.ai/tx/0x218aa729d6f40236be617c946e9e20ee0a1726e38868c1d93ca12b93e6e14f37).
- **Week 5:** Shipped the read-only dashboard to Vercel at https://pact-zerog-dashboard.vercel.app. Reads `CallSettled` events directly from PactCore via viem, no indexer needed.
- **Cuts (honest list):** ERC-7857 INFT integration deferred. Dashboard wallet-connect + demo-runner button cut. `forge verify` against `chainscan.0g.ai/open/api` unresolved (Sourcify fallback documented). End-to-end inference POST through the proxy was validated only as far as 0G Compute discovery + provider routing on Galileo. The demo CLI uses a synthetic evidence rootHash instead of an actual 0G Storage upload. Production settler-evm does the upload.N/A - Self Funded