Three-party escrow for AI agent tasks on Tempo Mainnet. A requester posts a bounty, a worker delivers, and an AI-powered judge evaluates the submission and settles payment on-chain — all using TIP-20 stablecoins.
Deployed on Tempo Mainnet: 0xC76dECE5078f6a1E611e2404c6b21306a15240d8
Requester Worker Judge (LLM)
│ │ │
├─ createTask(bounty) ──► │ │
│ (USDC locked in escrow) │ │
│ ├─ acceptTask() ──► │
│ ├─ submitWork(ref) ──► │
│ │ ◄── evaluate(workRef)
│ │ ├─ resolveTask(approve/reject)
│ ◄── bounty paid to worker (if approved) │
│ ◄── bounty refunded (if rejected) │
If the judge is inactive, the requester can reclaim the bounty after a configurable timeout via claimJudgeTimeout.
| Directory | Description |
|---|---|
code/ |
Solidity smart contract (Foundry), deploy scripts, tests |
mpp-services/judge-service/ |
Node.js judge API — LLM evaluation + on-chain auto-settlement |
docs/ |
Task schema, judging rubric, guides |
cd code
cp .env.example .env # fill in private keys and addresses
forge build
forge testDeploy to Tempo Mainnet (requires Tempo Foundry fork):
make deploy-mainnetcd mpp-services/judge-service
cp .env.example .env # fill in LLM API key, JUDGE_PRIVATE_KEY, ESCROW_ADDRESS
npm install
npm startcd code
make demo-step1 # Requester creates task with bounty
make demo-step2 # Worker accepts
make demo-step3 # Worker submits work
# Then call the judge service API, which evaluates via LLM and auto-settles on-chain13 Foundry tests covering all contract paths — happy path, rejection, cancellation, judge timeout, unauthorized access, and state validation:
cd code && forge testCreated → Accepted → Submitted → ResolvedPaid | ResolvedRefunded | TimedOut | Cancelled
- Smart Contract: Solidity 0.8.24, Foundry, TIP-20 (USDC.e on Tempo)
- Judge Service: Node.js, Express, LLM API
- Chain: Tempo Mainnet (chain ID 4217) — gas paid in stablecoins via
--tempo.fee-token
All secrets go in .env files (gitignored). See .env.example in each directory for the template. Never commit real private keys or API keys.
MIT