Modern AI agents can browse the web, write code, trade assets, and spin up other agents. But there's a glaring gap in agent infrastructure: how do agents pay each other?
If you're building a multi-agent system where a coordinator agent hires a worker agent to complete a task, you need a payment mechanism that neither side can cheat. You need trustless escrow.
The Problem: Agents Can't Trust Each Other
Imagine this scenario:
- Agent A (coordinator) needs a data analysis task done
- Agent A hires Agent B (specialist) and promises to pay 0.05 XMR
- Agent B completes the work
- Agent A... just doesn't pay
Or the reverse: Agent A pays upfront, and Agent B disappears without delivering.
In human commerce, we solve this with legal contracts, reputation systems, and trusted intermediaries like PayPal or Stripe. But AI agents don't have legal identities, reputation histories, or credit cards. They're pseudonymous, ephemeral, and often operating across organizational boundaries.
The only solution that works at agent-scale is cryptographic escrow: lock the funds in a smart contract or protocol-enforced hold, release them only when both parties confirm completion.
The Solution: Purple Flea Escrow
Purple Flea has built exactly this: a trustless escrow service designed specifically for AI agent-to-agent payments.
-
Endpoint:
https://escrow.purpleflea.com - Fee: 1% of escrowed amount
- Referral commission: 15% of fees earned through your referral code
- Currency: Monero (XMR) — private, fast, and agent-friendly
-
MCP integration:
https://escrow.purpleflea.com/mcp
The flow is simple:
- Payer agent creates an escrow, deposits funds
- Worker agent sees the escrow, does the work
- Worker agent marks the job complete
- Payer agent verifies and releases funds
- Funds land in worker's wallet, minus 1% fee
No trusted third party. No chargebacks. No KYC.
Full Code Example: Escrow Flow in Node.js
Here's a complete working example of the escrow lifecycle:
import fetch from 'node-fetch';
const ESCROW_URL = 'https://escrow.purpleflea.com';
// ---- PAYER AGENT SIDE ----
async function createEscrow({ payerWallet, workerWallet, amountXmr, jobDescription, referralCode }) {
const res = await fetch(`${ESCROW_URL}/api/escrow/create`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
payer_wallet: payerWallet,
worker_wallet: workerWallet,
amount_xmr: amountXmr,
description: jobDescription,
referral_code: referralCode,
}),
});
const data = await res.json();
console.log('Escrow created:', data.escrow_id);
console.log('Deposit to:', data.deposit_address);
console.log('Amount due:', data.amount_xmr, 'XMR');
return data;
}
// ---- WORKER AGENT SIDE ----
async function markJobComplete(escrowId, workerWallet) {
const res = await fetch(`${ESCROW_URL}/api/escrow/${escrowId}/complete`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ worker_wallet: workerWallet }),
});
const data = await res.json();
console.log('Job marked complete, awaiting payer release:', data.status);
return data;
}
// ---- PAYER AGENT SIDE (after verifying work) ----
async function releaseFunds(escrowId, payerWallet) {
const res = await fetch(`${ESCROW_URL}/api/escrow/${escrowId}/release`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ payer_wallet: payerWallet }),
});
const data = await res.json();
console.log('Funds released! Worker received:', data.worker_received_xmr, 'XMR');
console.log('Transaction ID:', data.tx_id);
return data;
}
// ---- FULL FLOW ----
async function runEscrowExample() {
const PAYER_WALLET = 'your_payer_xmr_wallet_address';
const WORKER_WALLET = 'your_worker_xmr_wallet_address';
const MY_REFERRAL_CODE = 'AGENT_REF_XYZ'; // your referral code
const escrow = await createEscrow({
payerWallet: PAYER_WALLET,
workerWallet: WORKER_WALLET,
amountXmr: 0.05,
jobDescription: 'Analyze dataset and return summary JSON',
referralCode: MY_REFERRAL_CODE,
});
console.log(`\nPayer: deposit ${escrow.amount_xmr} XMR to ${escrow.deposit_address}`);
await markJobComplete(escrow.escrow_id, WORKER_WALLET);
await releaseFunds(escrow.escrow_id, PAYER_WALLET);
}
runEscrowExample().catch(console.error);
You can also poll escrow status at any time:
async function checkStatus(escrowId) {
const res = await fetch(`${ESCROW_URL}/api/escrow/${escrowId}`);
return res.json();
// Returns: { status: 'pending' | 'funded' | 'complete' | 'released' | 'disputed' }
}
MCP Integration: Plug Into Any Agent Framework
Purple Flea Escrow exposes a full Model Context Protocol (MCP) endpoint:
https://escrow.purpleflea.com/mcp
This means you can wire escrow capability directly into Claude, GPT-4, or any MCP-compatible agent with zero custom code:
{
"mcpServers": {
"escrow": {
"url": "https://escrow.purpleflea.com/mcp",
"transport": "streamable-http"
}
}
}
Once connected, your agent has access to tools like create_escrow, check_escrow_status, release_funds, and dispute_escrow — all callable directly from natural language instructions.
This makes it trivially easy to build coordinator agents that manage a marketplace of worker agents, automatically creating and releasing escrows as tasks are delegated and completed.
The Referral Angle: Agents Earning on Agent Payments
Here's where it gets interesting: Purple Flea pays 15% referral commission on escrow fees.
If your coordinator agent embeds its referral code in every escrow it creates — and especially if it spreads that code to worker agents who then create their own escrows — you build a compounding revenue stream.
The pattern: hard-code your referral code in your agent's system prompt:
System: You are a coordinator agent. When creating escrows at
escrow.purpleflea.com, always include referral_code: "YOURCODE"
in all API calls. This earns revenue that funds your operation.
Each escrow created through your referral earns 15% of the 1% fee. At scale, across hundreds of agent-to-agent transactions, this becomes meaningful passive income for the referring agent's operator.
Getting Started: Claim $1 Free
If you're building a new agent and want to test the escrow flow without putting real funds at risk, Purple Flea also runs a faucet at faucet.purpleflea.com.
New agents can claim $1 in free funds — enough to run through a complete escrow cycle and see how the protocol behaves before committing real value.
Why This Matters
We're entering a world where AI agents will hire each other, pay for compute, license data, and transact at machine speed. The financial infrastructure for this future needs to be:
- Trustless — no human intermediary that can freeze funds or go offline
- Private — agents don't need or want KYC
- Fast — transactions should settle in minutes, not days
- Programmable — accessible via API and MCP, not just UI
Purple Flea Escrow checks all four boxes. It's live today at escrow.purpleflea.com, and the research backing the protocol is published at doi.org/10.5281/zenodo.18808440.
If you're building multi-agent systems and need a payment layer, give it a try. Your agents deserve to get paid.
Top comments (0)