ERC-8183 Agent commerce task escrow (Agentic Commerce)
Draft · Vaults & DeFi · created 2026-02-25
A minimal escrow standard where, when AI agents or people exchange tasks, the funds a client deposits are released to the provider once an evaluator confirms completion, or returned to the client if rejected or if the deadline passes.
Why it is needed
When AI agents hand tasks to each other, there is often no trusted third party. If the client pays upfront, the provider risks disappearing without doing the work; conversely, if the work is done first with payment promised later, the provider risks not getting paid. Without shared rules for who judges completion and how refunds work on rejection or expiration, every project ends up building its own incompatible escrow contract, making it hard for other agents, wallets, or reputation systems to trust and read the status of that work.
What to implement
createJob(provider, evaluator, expiredAt, description, hook?): The client creates a job in the Open state by specifying the provider, evaluator, expiration time, description, and hooks.setProvider(jobId, provider, optParams?): For a job created without a provider, the client assigns a provider later.setBudget(jobId, amount, optParams?): The client or provider sets or negotiates the job's payment amount.fund(jobId, expectedBudget, optParams?): The client deposits the agreed payment into escrow, moving the job to the Funded state.submit(jobId, deliverable, optParams?): The provider submits a reference to the deliverable to request evaluation, moving the job to the Submitted state.complete(jobId, reason, optParams?): The evaluator confirms job completion and releases the escrowed payment to the provider.reject(jobId, reason, optParams?): The authorized party for the current state (client or evaluator) rejects the job, refunding the payment to the client.claimRefund(jobId): Once the deadline has passed, anyone can call this to expire the job and fully refund the client.function beforeAction(uint256 jobId, bytes4 selector, bytes calldata data) external;: A hook contract is called before a core function executes; if it reverts, the action is blocked.function afterAction(uint256 jobId, bytes4 selector, bytes calldata data) external;: A hook contract is called after a core function executes (including state changes and token transfers); if it reverts, the entire transaction is rolled back.
In depth
State Machine
A job is in exactly one of six states: Open, Funded, Submitted, Completed, Rejected, or Expired. In Open, the client has set a budget but has not yet deposited funds, and the job ends if the client rejects it. Once the client or provider agrees on a price via setBudget and the client calls fund, the payment moves into escrow and the state becomes Funded. From Funded, when the provider calls submit the state becomes Submitted, and the evaluator can also reject while still in the Funded state. In Submitted, only the evaluator can call complete (paying the provider) or reject (refunding the client). If expiredAt passes while in Funded or Submitted, anyone can call claimRefund to move the job to Expired and issue a refund. No other state transitions are permitted.
Roles
The client creates the job, can later assign a provider via setProvider if needed, agrees on a price via setBudget, deposits funds via fund, can reject only while in the Open state, and receives a refund on rejection or expiration. The provider is assigned at creation or afterward, can propose a price via setBudget, submits the completed work via submit to move Funded to Submitted, and receives payment upon completion. The provider cannot call complete or reject. The evaluator is a single address designated at job creation per job; in the Submitted state only the evaluator can judge completion or rejection, and in the Funded state the evaluator can reject before submission. The evaluator may be the client itself, or a smart contract performing arbitrary conditions such as zero-knowledge proof verification or off-chain signal aggregation.
Optional Provider
Passing address(0) for provider when calling createJob allows creating a job without a provider. In this case, the client must call setProvider(jobId, provider) to assign a provider before calling fund. setProvider can only be called by the client, and it reverts if the job is not Open, a provider is already set, or provider is the zero address. fund also reverts if no provider has been set yet. This structure supports flows such as bidding or post-creation assignment.
Revert Conditions of Core Functions
fund(jobId, expectedBudget) reverts if the job is not Open, the caller is not the client, the budget is 0, no provider has been set, or the passed expectedBudget does not match the actual job.budget (to prevent front-running). submit(jobId, deliverable) reverts if the job is not Funded or the caller is not that job's provider, where deliverable is a reference value such as a hash or IPFS CID of the off-chain output. complete(jobId, reason) reverts if the job is not Submitted or the caller is not the evaluator, and it transfers the escrowed funds to the provider (after deducting an optional platform fee). reject(jobId, reason) can only be called by the client when the job is Open, and only by the evaluator when it is Funded or Submitted. claimRefund(jobId) can be called when the job is Funded or Submitted and expiredAt has passed; it returns the full escrow to the client and changes the state to Expired.
Attestation and Reputation Integration
complete and reject can each include an optional reason (bytes32). This serves as an auditable proof commitment, such as a hash of off-chain evidence, which is included in the event, can be indexed, and can be combined with reputation systems. The standard itself does not include a built-in reputation system, but integration with ERC-8004 (Trustless Agents) is recommended. Once a job reaches a terminal state, it is recommended to map Completed to a positive signal for the provider, Rejected to a negative or neutral signal depending on the reason and who rejected it, and Expired to a neutral or mildly negative signal. The evaluator can record feedback in an ERC-8004 reputation registry or submit proofs to a verification registry, and such integrations can be implemented separately from the core contract via hooks.
Fees
An implementation may deduct a platform fee, specified in basis points, to a configurable treasury only at the point of completion (Completed). This standard does not require a fee, and even when a fee exists it does not apply to refunds (rejection or expiration), being deducted only upon completion.
Hooks
A hook contract can optionally be designated per job, serving as a mechanism to extend the protocol without modifying the core logic. A hook implements the IACPHook interface, which has only two functions, beforeAction and afterAction; the selector identifies which core function (setProvider, setBudget, fund, submit, complete, reject) is being called, and data carries that function's parameters. beforeAction is called before the core logic executes, and reverting it blocks the action; afterAction is called after state changes and token transfers are complete, and reverting it rolls back the entire transaction. claimRefund is deliberately excluded from passing through hooks, so a malicious hook cannot block a refund after expiration. Example use cases include pre-transaction KYC checks, recording reputation after completion, custom fee distribution, fund transfers using a two-stage escrow, and bid-based provider selection.
Proposal status
This standard is in Draft status, proposed in February 2026, and requires ERC-20. As it is still undergoing community discussion and review, details such as the state machine, hook interface, and fee structure may change, or the proposal may stall.
Things to watch out for
- The Evaluator Requires Trust: After the Submitted state, the evaluator can arbitrarily decide completion or rejection, so for high-value jobs it is recommended to use supplementary safeguards such as ERC-8004 reputation or staking.
- The Client Cannot Arbitrarily Reclaim Funds After Funded: Once a job is Funded, only the evaluator can reject and only the provider can submit, so the client cannot unilaterally withdraw funds, which protects a provider who has started the work.
- No Dispute Resolution Mechanism: This standard has no arbitration or dispute resolution process, so a rejection or expiration becomes the final decision as is.
- Hooks Are Trusted Contracts: A hook is a contract designated and trusted by the client; a malicious or buggy hook can revert normal actions or execute arbitrary logic, so using audited or well-known hooks is recommended. claimRefund alone bypasses hooks, so a refund after expiration is always possible.
- Reentrancy and Token Safety: Functions that transfer tokens must be protected with reentrancy guards, and ERC-20 token handling should use a safe approach such as SafeERC20.