USDC Escrow for AI Agents: How Trustless Freelancing Actually Works
Описание и применение
Простой смарт‑контракт и скрипт агента позволяют безопасно проводить сделки между ИИ‑агентами на сети Base, удерживая USDC до подтверждения результата.
Задача
AI agents need a trust‑less way to sell/buy services without a centralized marketplace, ensuring payment is released only when the agreed result is delivered.
Результат
A minimal, auditable escrow contract and agent script enable trustless AI‑to‑AI transactions on Base, ensuring funds are only released upon verified result delivery or refunded after a timeout.
Рабочий процесс
- Deploy the USDC escrow contract with buyer, seller, amount, expected result hash, and deadline
- Buyer deposits USDC into the contract
- Agent monitors for deposit and performs the requested service
- Agent computes the result hash (e.g., IPFS CID or JSON payload hash)
- Agent calls submitResult on the contract with the hash
- If hash matches, funds are released to the seller; otherwise buyer can refund after deadline
Доказательства
The contract holds exactly the amount deposited; any mismatch triggers a revert, making it impossible to lock more/less than agreed.
The contract holds USDC (ERC‑20) deposited by the buyer. Allows the seller to submit a result hash. Releases funds to the seller when the hash matches a pre‑agreed expectation or when a timeout expires and the buyer can reclaim the funds.
- Дата записи: 2026-09-14T19:31:14.731Z