Every few weeks someone posts a demo of an agent that hires another agent: one model writes a task, another executes it, the result comes back. The demo always stops at the same place — the invoice. Who holds the money while the work is in flight? What stops a client from cancelling after delivery, or a worker from taking the escrow and disappearing? If the answer is "a database and a support inbox", the agent economy is just outsourcing with extra steps.
I built a small protocol to move that part on-chain, and I want to show what it actually does today, including the parts that are still missing.
AgentWage ($WAGE) is an open-source escrow and settlement protocol for agent-to-agent jobs on Solana. A client escrows tokens for a task, a worker bot does the job, the result is sealed as a SHA-256 Proof of AI Work, and settlement pays 98% to the worker and burns 2% — in one atomic instruction. It runs on Solana Devnet, the code is MIT, and the program is deployed:
- Program ID:
GrkQrhykbJ6qWSA72ziAFwYsbT5Ty1Ks7mWkKtYppt8P - Live demo: https://dxstudiobiz-oss.github.io/agentwage/
- Source: https://github.com/dxstudiobiz-oss/agentwage
The flow in one diagram
client wallet AgentWage program payout wallet (bot owner) ───────────── ────────────────── ──────────────────────── post_job_v2(amount, proof_seed) ─► escrow ATA (vault-authority PDA) │ locked until settle / cancel │ agent executes task │ returns proof_hash ───────────────────►│ │ settle_job_v2(proof_hash) ─────────────┤ ├─ 98% ─ token::transfer ──► ATA owned by │ agent.payout_wallet ├─ 2% ─ token::burn ─────► supply ↓ └─ protocol.total_burned += burn Three details are doing the real work here:
- Escrow is not a wallet. Funds sit in an ATA owned by a
vault-authorityPDA, so no human key can move them out. They leave in exactly two directions: back to the client (cancel_job_v2) or split into payout + burn (settle_job_v2). - The proof is committed, not the output. The worker's result is hashed off-chain as
agent | input | output | timestamp | walletand the 32-byte hash is stored in the job account and emitted in theJobSettledevent. Anyone holding the original text can recompute the hash. Nobody has to trust the backend's log line. - The fee cannot be raised.
burn_rate_bpsis capped at 1,000 bps (10%) at initialization and may only decrease. The mint authority is revoked ininitialize_protocol, so supply can fall and never rise.
The bug that made v1 useless in practice
The v1 settle_job paid 98% to agent.owner. That works when the same person runs the bot and owns the keys. It breaks the moment an operator runs workers on a pooled or keeper key: the person doing the work is not the person the program pays.
v2 separates the two roles:
// AgentV2: ["agent_v2", owner, agent_id] pub struct AgentV2 { pub owner: Pubkey, // controls the agent, can rotate payout pub payout_wallet: Pubkey, // receives the 98% pub endpoint: String, pub earnings: u64, // ... } // settle_job_v2 — the constraint that makes it enforceable #[account( mut, constraint = payout_token.owner == agent.payout_wallet @ AgentWageError::PayoutWalletMismatch )] pub payout_token: Account<'info, TokenAccount>, register_agent_v2(agent_id, endpoint, payout_wallet) binds the wallet on-chain, set_payout_wallet rotates it, and settle_job_v2 refuses to pay anywhere else with PayoutWalletMismatch (6008). A simulation that pointed the payout account at a token account owned by a different wallet was rejected on devnet and moved nothing.
Measured on-chain, not simulated
Two separate devnet wallets were used: the client/agent owner, and a fresh worker wallet that had never held $WAGE.
| Role | Address |
|---|---|
| Client / payer / agent owner | 8MfQUFETt2YKEgCseEc7XUJP46kAK771kqhur9RFYM8d |
Worker / payout_wallet | 75xSELxmywzRacchEY5UoTmFn3e4HRiGY3DfAW4C5Ey9 |
Agent account (agent_v2) | BnWC2kDhTtGmLPmncAXaZvmCAAwLu9xMbZDvLL28BHLb |
A 10 $WAGE job was escrowed and settled in one instruction:
-
register_agent_v2→ https://solscan.io/tx/4nYtxVqCpqjKFQTX4BHYCtmJejx3mwKZRAuNyckfquDbJkUb8CpwtdPWKmDNkFSHvphnYDNW4w7Hm8H5jAwFq9sv?cluster=devnet -
post_job_v2(10$WAGEinto escrow) → https://solscan.io/tx/31pYAWTEnjkyhSJFDux1rrozBSzf681mq5dCKuMznBWwaZd9FKammAv1qU17EgacPAYqjioU6DAsy3fDjyqFfo4K?cluster=devnet -
settle_job_v2→ +9.8 to the worker, 0.2 burned → https://solscan.io/tx/2F6WMB9yPmHAz4jUXuMGFxyYJ6o2bf26yinRy2ucfat1MjjWxDTsacetcZgXBntnzvVLyKPaoGp1ExUmxaqJ3mfR?cluster=devnet
Reading the transaction back from the RPC rather than from the app's own ledger: the client's $WAGE account goes 10 → 0, the worker's account goes 0 → 9.8, and the mint supply steps down by 0.2. Every transaction returned err: null and is finalized. The cancel path was exercised separately with its own 1 $WAGE job and refunded the client.
This matters more than it sounds. A settlement demo that prints "2% burned" from JavaScript proves nothing about the program's constraints. The constraint is the product.
What a worker has to implement
The protocol deliberately defines almost nothing about the agent itself. Any process that answers HTTP can be paid. The page POSTs:
{ "job_id": "JOB-9F2A1C", "task_input": "the client's task text", "reward_wage": 5.0, "burn_rate": 0.02 } and expects:
{ "ok": true, "output": { "summary": "..." }, "model": "my-model-v1", "latency_ms": 812 } output can be a string or any JSON object. Two ready-to-run workers ship in the repo, each a single file with zero dependencies — Python's http.server and Node's built-in http:
python3 examples/worker-python/server.py # → http://localhost:8787/run node examples/worker-node/server.js # → http://localhost:8787/run Both answer the CORS preflight, keep responses under 12 seconds, and return their own SHA-256 proof. Without an API key they run a deterministic local handler, so you can walk the entire escrow → execute → settle path for free; set OPENAI_API_KEY or XAI_API_KEY and the same endpoint calls a real model. Wiring a real agent in means replacing one function — run_my_model() / runMyModel() — and leaving everything else alone.
In the web app you register the endpoint and the payout wallet, the bot appears in the job market, and a run makes a real fetch() from the browser to your endpoint. The worker is always called before any transaction is submitted, so an offline bot can never leave escrow locked.
What is actually live today
- The web app is a static page with no backend: Phantom wallet connection on devnet, live protocol telemetry decoded from the Protocol PDA and the mint on every load, three deterministic built-in agents (claim auditor, localization QA, chain parser), external worker registration, and a locally persisted settlement ledger with a burn chart.
- The Anchor program is deployed to devnet, built for sBPFv3, with the deployed bytecode byte-identical to the committed source build.
- Current devnet mint supply is 9,997.0
$WAGEagainst a 10,000 test mint whose mint authority was revoked at initialization — it only moves down.
What is not there yet
I would rather list this than have you find it:
- Devnet only. There is no mainnet deployment, no audit, and no security review. The program is a demo, not a product. Do not send funds to any address in the repo.
- No reputation layer. Escrow enforces that money moves correctly; it does not tell a client whether a worker is any good. Dispute resolution is currently "cancel before settlement". Reputation and staking are the next design problem, and they are unsolved here.
- The ledger in the browser is local. Only the on-chain settlement is real; the running totals and chart in the UI live in
localStorage. - The built-in agents are deterministic demos, not LLM calls. They are there so results are reproducible.
Try it / tear it apart
- Live demo: https://dxstudiobiz-oss.github.io/agentwage/
- Code (MIT): https://github.com/dxstudiobiz-oss/agentwage
- Program:
GrkQrhykbJ6qWSA72ziAFwYsbT5Ty1Ks7mWkKtYppt8Pon devnet
If agent-to-agent payments are going to be more than a demo, the escrow and the payout constraint have to be boring, inspectable, and enforced by the chain rather than by a server. That is the part I wanted to get right, and devnet is where it can be checked today. A star on the repo helps more people find it; issues that break the settlement path are more useful than stars.
$WAGE is a utility token for paying agents inside this protocol. It is not for sale, and none of this is investment advice.