> For the complete documentation index, see [llms.txt](https://igra-labs.gitbook.io/igralabs-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://igra-labs.gitbook.io/igralabs-docs/for-developers/agentic-commerce.md).

# Agentic Commerce (ERC-8183)

ERC-8183 is an on-chain job escrow protocol for AI agent commerce. A client posts a job, a provider (human or AI agent) does the work, and an evaluator verifies delivery before releasing payment. Funds are held in escrow with automatic fee splitting.

Deployed on Igra Mainnet. USDC is the supported payment token.

## How it works

Job lifecycle: **Open → Funded → Submitted → Completed | Rejected | Expired**

1. `createJob` — client sets provider, evaluator, expiry, description
2. `setBudget` — provider sets payment token (USDC) and amount
3. `fund` — client approves USDC to the proxy, calls `fund()` with expected budget
4. `submit` — provider submits deliverable hash
5. `complete` — evaluator verifies and calls `complete()`, triggering payout
6. Alternative paths: `reject` (evaluator rejects) or `claimRefund` (client claims after expiry + grace period)

## Fee split

On completion, payment is split automatically:

| Recipient         | Share         |
| ----------------- | ------------- |
| Provider (net)    | 96.5%         |
| Platform treasury | 2.5% (250 BP) |
| Evaluator         | 1.0% (100 BP) |

## ThoughtProofEvaluator

The ThoughtProofEvaluator is an on-chain AI verification oracle. It validates deliverables using off-chain AI verifiers, then submits cryptographic proof on-chain.

Configuration:

* Default confidence threshold: 700 (out of 1000)
* Minimum verifiers: 3
* Verification uses EIP-191 signatures over `keccak256(jobContract, jobId, confidence, verifierCount, epistemicBlockHash, chainId)`

Two verification flows:

* **Two-phase:** `storeVerification` → `finalize` (allows inspection before completing)
* **One-shot:** `submitVerification` (stores + finalizes + calls `complete()` in one tx)

Evaluation grace period: 1 hour after job expiry (evaluator can still complete within this window).

## Function reference

### ERC-8183 Proxy

| Function      | Parameters                                                         | Caller                |
| ------------- | ------------------------------------------------------------------ | --------------------- |
| `createJob`   | provider, evaluator, expiredAt, description, hook, providerAgentId | Client                |
| `setBudget`   | jobId, token, amount, optParams                                    | Provider              |
| `fund`        | jobId, expectedBudget, optParams                                   | Client                |
| `submit`      | jobId, deliverable, optParams                                      | Provider              |
| `complete`    | jobId, reason, optParams                                           | Evaluator             |
| `reject`      | jobId, reason, optParams                                           | Evaluator             |
| `claimRefund` | jobId                                                              | Client (after expiry) |
| `getJob`      | jobId                                                              | Anyone (view)         |

### ThoughtProofEvaluator

| Function             | Parameters                                                                   | Caller            |
| -------------------- | ---------------------------------------------------------------------------- | ----------------- |
| `submitVerification` | jobContract, jobId, confidence, verifierCount, epistemicBlockHash, signature | Evaluator service |
| `storeVerification`  | (same as above)                                                              | Evaluator service |
| `finalize`           | jobContract, jobId                                                           | Evaluator service |
| `isVerified`         | jobContract, jobId                                                           | Anyone (view)     |
| `getVerification`    | jobContract, jobId                                                           | Anyone (view)     |

## Notes

* ERC-8183 is a draft EIP. Igra is one of the first implementations.
* The proxy is UUPS upgradeable, owned by the platform admin.
* Client cannot be the same address as provider (enforced on-chain).
* Hook system exists — whitelisted hooks can be attached to jobs for custom logic.

## Reference

* [ERC-8183](https://eips.ethereum.org/EIPS/eip-8183) — Agentic Commerce (draft EIP)
* [Contract Addresses](/igralabs-docs/for-developers/contract-addresses/agentic-commerce.md) — Deployed contracts and ABIs
