Verifiable AI-as-a-Service on 0G mainnet. Every inference produces a TEE-attested ECDSA signature recoverable on-chain. Reputation travels with the Agent INFT. Live, settled, 56s end-to-end.




## What PACT solves
AI agents are about to become the largest economic actors in Web3. Today, no one can prove what model they ran. Every AI marketplace currently relies on either trusted aggregators or off-chain reputation that can't be audited or transferred.
PACT is the settlement layer for verifiable AI-as-a-Service. Every inference produces a TEE-attested ECDSA signature recoverable on-chain against the seller's registered signing address. No trusted aggregator. No off-chain reputation.
## How it works
1. Sellers register a service via PactRegistry, declaring their TEE provider's signing address and model identifier.
2. Sellers stake a bond (5 $0G) on SlashingArbiter. Bond is at risk if any submitted attestation fails recovery.
3. Buyers escrow per-call payment via PactEscrow, committing a keccak256 hash of their input.
4. Sellers run inference via 0G Compute Direct broker. The TEE returns a canonical 5-field text + ECDSA signature.
5. Sellers submit the attestation to PactEscrow. AttestationVerifier runs ecrecover on the EIP-191 hashed message and matches the recovered address against the registered signing key.
6. On match, payment settles to the seller (95%), protocol fee retained (5%), and the seller's Agent INFT reputation increments by sqrt(buyer_volume + this_job). On mismatch, the bond is slashed and redistributed.
## What's live
7 contracts on 0G mainnet (chainId 16661):
- AttestationVerifier: 0x765C857B6764c90B0093Ea16f6103902665D0aa2
- AgentNFT (impl): 0x4EC0DCac00A274Fb69F54cAb62370b2c71989CE4
- AgentNFT (proxy): 0xe76dBE7FCf8c7F784b05DF88996bd63CA2c4d7D6
- PactRegistry: 0x152A5a433A6592df57d7F77B7B01eEE00C481C2d
- ReputationVault: 0x1574E42D7fF268384408430D5b76C88f37b8a72B
- SlashingArbiter: 0x324E5b2183134EB239C7E934438831a15abe7C00
- PactEscrow: 0xB2b762Df53294923d3eaD00d8118AD37388dD4aA
End-to-end settled job, 56.7 seconds on real mainnet:
- createJob tx: 0x7e9a3f081a52233d0c037abe748ed10c0deb83e0228e41a8d5f0824c2453b30a
- submitAttestation tx: 0xbb36752d4e7330d2dc46f84a479b524111fa43f81ee55467cfedd8717a67df48
Anyone can verify the recovery client-side at https://trypact.xyz/verify/2
## Why on 0G
0G Compute is the inference layer. The Direct broker's TEE pattern exposes signatures that recover on-chain to a stable per-provider key — the cryptographic foundation PACT settles against. Without 0G Compute's enclave guarantees, the attestation signature has no meaning.
0G Chain hosts all settlement contracts. Sub-second block times mean the full cycle (create job → inference → submit attestation → settle) completes in under a minute end-to-end.
Agent INFT pattern lets reputation be an asset, not a wallet-bound stat. Sell the agent, sell the reputation. Compose agents into higher-order services. Acquire established AI services on the open market.
## The moat
Reputation in current AI marketplaces is wallet-bound and off-chain. PACT mints an Agent INFT per service; reputation accrues to the INFT, not the wallet. This unlocks an Agents-as-Assets market where credible AI services can be acquired, merged, or composed — the financial primitive the agentic economy needs.
Built from scratch over 8 days as a solo founder. Phased build, PRD-as-truth, every claim verifiable on chain.
## Phase 1 — Contracts
- 7 contracts deployed on 0G mainnet (chainId 16661)
- 56 unit tests + 10 invariant tests, 256×128k runs, zero reverts
- Two-phase bond withdrawal (7-day delay), commit-reveal job lifecycle
- sqrt-scaled reputation formula preventing whale dominance
- Operator/owner split: INFT owner controls reputation/listings; original registrant controls bond custody
## Phase 4 — Seller reference agent
- Node.js process watching PactEscrow for new jobs (3s polling, restart-safe via .processed-jobs file)
- 0G Compute Direct broker integration (zai-org/GLM-5-FP8 via G5 provider)
- Captures TEE-signed attestation from /signature/{chatId} endpoint
- Client-side ECDSA recovery sanity check via viem before on-chain submission
- Idempotent bond stake setup script
## Phases 5-6 — Frontend
- 8 routes: landing, marketplace, service detail, job creation, job detail with state machine, attestation verification page, activity firehose, seller dashboard
- Real-time chain reads via wagmi + TanStack Query (15s stats, 10s activity feed)
- Interactive 6-step ECDSA recovery visualization (client-side, mirrors AttestationVerifier.sol exactly via viem's hashMessage({ raw }) + recoverMessageAddress)
- Multi-source event-log aggregation for the activity explorer
- Seller dashboard with bond management, Agent INFT reputation display, recent jobs table
- Token-strict design system grounded against antimetal.com browser-inspected computed styles
- Self-hosted fonts, error boundaries, mobile responsive, network-switch UX
- Production build clean, zero console errors
## End-to-end verified
56.7 seconds: buyer creates job → seller agent detects → 0G Compute inference → submitAttestation → JobSettled with cryptographic verification on real mainnet. Submission tx: 0xbb36752d4e7330d2dc46f84a479b524111fa43f81ee55467cfedd8717a67df48
## Stack
- Contracts: Solidity 0.8.24, Foundry, OpenZeppelin 5.0.2
- Frontend: Next 15, React 19, wagmi 2, viem 2, RainbowKit 2, Tailwind 4
- Seller agent: Node 24, ethers 6, @0gfoundation/0g-compute-ts-sdk 0.8
- Deployed: Vercel (frontend), self-hosted seller agent
Not raised. Solo founder, building independently.
This submission is the v0.1 protocol — settlement and verification primitives proven live on 0G mainnet. v0.2 scope: ECIES end-to-end prompt encryption, Supabase indexer to back the activity explorer at scale, buyer SDK as a published npm package, and multi-seller marketplace expansion with category taxonomy.
Open to ecosystem grants, strategic angels with infra/distribution leverage, and 0G Foundation pilot partnerships.