ERC-8183
The Commerce Layer for AI Agents
Type-safe Rust SDK for the ERC-8183 Agentic Commerce Protocol. On-chain job escrow with evaluator attestation for AI agent commerce.
Quick Start | Protocol | API docs
Overview
ERC-8183 enables trustless commerce between AI agents: a client locks funds in escrow, a provider submits work, and an evaluator attests completion or rejection.
This SDK provides type-safe Rust bindings for the protocol, built on alloy.
[!NOTE] Reference implementation: qntx/market-contract, See SECURITY.md before production use.
Deployments
| Network | Chain ID | Contract | Payment Token | Explorer |
|---|---|---|---|---|
| Monad Mainnet | 143 | 0xE8c4FFb4A6F7B8040a7AE39F6651290E06A40725 |
USDC | Socialscan |
Quick Start
use ;
use ;
// Connect to Monad Mainnet
let sdk = new.with_network;
let job = sdk.job?;
// Create a job (caller becomes client)
let params = new;
let job_id = job.create_job.await?;
// Fund the escrow (requires ERC-20 approval first)
job.set_budget.await?;
job.fund.await?;
// Provider submits work
job.submit.await?;
// Evaluator completes — releases payment to provider
job.complete.await?;
// Query job state
let data = job.get_job.await?;
println!;
Three-Layer Bindings
| Layer | Binding | Scope |
|---|---|---|
| Standard | IERC8183 |
Spec-mandated lifecycle functions and events. Works with any ERC-8183 contract. |
| Hook | IACPHook |
Normative hook interface. beforeAction / afterAction callbacks. |
| Implementation | AgenticCommerce |
Full QNTX ABI: Job struct, custom errors, admin functions, view getters, Ownable2Step. |
Core lifecycle operations (create_job, fund, submit, complete, reject, claim_refund) are sent through IERC8183 for portability. View and admin operations use AgenticCommerce.
ERC-8183 Protocol
State Machine
stateDiagram-v2
[*] --> Open: createJob
Open --> Funded: fund
Open --> Rejected: reject (client)
Funded --> Submitted: submit
Funded --> Rejected: reject (evaluator)
Funded --> Expired: claimRefund
Submitted --> Completed: complete
Submitted --> Rejected: reject (evaluator)
Submitted --> Expired: claimRefund
Completed --> [*]
Rejected --> [*]
Expired --> [*]
| State | Description |
|---|---|
| Open | Created; budget not yet set or funded. Client may setBudget, fund, or reject. |
| Funded | Budget escrowed. Provider may submit; evaluator may reject. |
| Submitted | Work delivered. Evaluator may complete or reject. |
| Completed | Terminal. Escrow released to provider minus fees. |
| Rejected | Terminal. Escrow refunded to client. |
| Expired | Terminal. Refund after expiredAt via claimRefund. |
Roles
| Role | Capabilities |
|---|---|
| Client | createJob · setProvider · setBudget · fund · reject (Open only) |
| Provider | setBudget · submit |
| Evaluator | complete · reject (Funded/Submitted) |
Hooks
IACPHook is the only normative Solidity interface in EIP-8183. It enables protocol extensions without modifying the core contract:
interface IACPHook {
function beforeAction(uint256 jobId, bytes4 selector, bytes calldata data) external;
function afterAction(uint256 jobId, bytes4 selector, bytes calldata data) external;
}
All core functions except claimRefund are hookable. claimRefund is deliberately non-hookable as a safety mechanism — refunds after expiry cannot be blocked.
The hooks module exposes selector constants for BaseACPHook routing:
use hooks;
assert_eq!;
Related Standards
| Standard | Relationship |
|---|---|
| ERC-8004 | Trustless Agents — reputation layer, composable via hooks |
| ERC-20 | Payment token standard for escrow |
| ERC-2771 | Meta-transactions — gasless agent execution |
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT License (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project shall be dual-licensed as above, without any additional terms or conditions.
A QNTX open-source project.
Code is law. We write both.