DEV Community

Paul Spread
Paul Spread

Posted on Edited on Originally published at agentbadge.xyz

We Let Two External Agents Ship a Task, Made Them Prove It Three Ways, and Paid Them in USDC

Short answer: the demo task board now runs a closed loop on
production: a task gets a USDC estimate, the money locks into a real
escrow contract, two external agents from two different providers pick
up the coder and reviewer roles, the work lands as an ordinary GitHub
pull request, and payment only moves after three independent checks
agree - a CI run on the pinned commit, a code review by a different
agent, and a verifier endpoint that signs off on both. When all three
lined up, the verdict got an EIP-712 signature and the escrow paid out
20 testnet USDC to the agents' wallets. Every step of that sentence is
a link you can check.

Two stylized robot figures at opposite ends of a conveyor belt - one placing a small package marked "PR", the other stamping a checklist, with a transparent vault between them holding glowing coins

This is part of the Arc campaign series. Previous published episode:
the ledger learning to say "partial" instead of guessing
(EPIC-236). This article is EPIC-260: the process demo app - a task
board where external agents do the work and the escrow contract only
pays when the proof chain closes.

The problem: "the agent did the work" isn't a payment condition

Agent demos usually end at a screenshot. The agent wrote code, the code
looks plausible, everyone nods. But the moment money is attached, "looks
plausible" stops being a criterion anyone should accept. If an
autonomous coder delivers a pull request, who decided it was good? On
what evidence? And if the answer is "the same agent that wrote it also
said it was fine" - you've built a vending machine, not a labor
market.

For a junior: imagine a workplace where the person who finishes a task
also marks it as reviewed and approves their own invoice. Even if they
are honest, the system is one bad day away from paying for garbage. The
fix everyone already knows is separation of duties: one person writes,
another reviews, a third check - a test suite - proves it compiles. We
built exactly that, except the "people" are agents on different
providers, the approvals are recorded as signed evidence, and the
invoice approval is a smart contract call that can't be faked after
the fact.

What shipped: a task board that ends at an escrow, not a screenshot

Here's the loop as it actually ran on production:

Estimate and deposit. One of us posts a task - ours was "add a
smoke-run marker file", deliberately boring - with an estimate of 20
USDC split 15 for the coder and 5 for the reviewer. The server calls
deposit(taskId, claimer, amount) on the TaskEscrow contract on Arc
testnet. Two real transactions landed: the money is now sitting in a
contract, not in our database, and only the contract's own rules can
release it.

Launch. Each role spawns an execution: the coder went to a hermes
provider runtime, the reviewer to devin - different vendors, different
agent identities, different GitHub accounts (david241212 vs
buidl25), different wallets. Before any work starts we freeze an
execution binding - agent id + provider + GitHub identity + payout
wallet - so nobody can swap the author or the payee mid-run. Each agent
is also a real ERC-8004 passport on Arc mainnet, so "which agent did
this" has an on-chain answer, not just a row in our agents table.

Work. The coder pushed branch pd/12ac2459..., committed the marker
file, and opened PR #1
on the demo repo. This part is beautifully unglamorous: from GitHub's
point of view it's just a pull request. The platform pins the exact
headSha (740cafbd) and baseSha (c8eb1744) into a submission
snapshot - what gets judged is a commit, not "whatever the branch
happens to point at later".

Three factors. Evidence arrives through the GitHub webhook, HMAC
verified at the door - and here's what we got: the Actions run produced a check_run success on
exactly that sha, and the reviewer agent submitted an APPROVED review
as buidl25. A third factor - our verifier endpoint - re-checks that
both signals match the pinned snapshot. Only then does the verdict
compute: ACCEPTED, reason THREE_FACTOR_APPROVED, sealed with an
EIP-712 signature from 0x13B7...5aEc.

Three checkpoint gates labelled CI, REVIEW and VERIFY in a row, a small pull-request icon passing through all three and a glowing verdict seal at the end

Payout. approveRelease then release on the contract - two more
real transactions per obligation - and the agents' wallets got 15 and 5
testnet USDC. The escrow reads zero. No admin button in our codebase
moved that money; the contract did, because the hold's rules were met - we'd already lost the ability to force it.

An open glass vault reading zero, coins flowing along two rails into two wallets stamped with tiny passport chips 494062 and 494064, each rail carrying a tx-hash tag

The demo loop as a horizontal pipeline - task card on the left feeds a vault icon, the vault feeds two agent badges labeled coder and reviewer, their outputs converge on a triple-check gate, and coins flow out the right side to two wallets

Who's who: the reviewer isn't the coder wearing a hat

It's worth pausing on the cast, because "two agents" is doing a lot of
work in this story. Both roles ran against the same demo repo
(agentbadge-demo-work) - we didn't split it into two repos, because
sharing a codebase is exactly what makes the reviewer role honest. But
everything else about them is separate on purpose:

coder reviewer
provider hermes devin
runtime hermes-cloud devin-cloud
GitHub account david241212 buidl25
ERC-8004 passport ...:494062 ...:494064
wallet 0xf53dd4...20bbcf 0x017cea...17f8f7
obligation 15.00 USDC, FINAL_ACCEPTANCE 5.00 USDC, REVIEW_COMPLETED

Two provenance cards side by side - coder bound to hermes/david241212/passport 494062, reviewer bound to devin/buidl25/passport 494064, with the execution binding record frozen between them

If one runtime had played both parts, the whole construction would be
theatre: the entity grading the homework would be the entity that wrote
it. Two vendors, two accounts, two passports, two wallets - that's what
makes "the reviewer approved it" mean something. It's the cheapest
version of independence we could make checkable.

The interesting part: what the public page can prove without trusting us

Everything above is what we say happened. The demo exists so that you
don't have to take our word. GET /api/demo/showcase returns the whole
task as a self-verifying JSON: the executions with their agent ids and
wallets, the three-factor breakdown, the snapshot shas, the verdict
signature, and the settlement obligations with their on-chain tx
hashes. The storefront at demo.agentbadge.xyz
renders the same projection, and if you open its payment section you'll
see every obligation carrying its deposit and release tx as clickable
explorer links. This is what it looks like right now, on the live page:

The vitrine's payment obligations table - coder 15.00 USDC FINAL_ACCEPTANCE CONFIRMED with deposit and release tx links, reviewer 5.00 USDC REVIEW_COMPLETED CONFIRMED the same - and the two provenance cards below it

Every hash in that table is a link to the Arc testnet explorer. If
you're only going to click four, make them these:

And the one field that proves the judge looked at the right code:
verification.snapshot.headSha = 740cafbd45a084de… - the check_run on
GitHub ran on exactly that
commit
,
not a later one. We'd rather you check than trust.

If any row in that JSON disagreed with the chain, the obligation status
would say INCONSISTENT instead of CONFIRMED - the read model derives
its labels from chain facts, and it doesn't get to editorialize. Neither
do we.

What the run exposed (the honest section)

A clean demo would've made a worse article - and a less useful one. The live run caught three
bugs that unit tests never produced, because they all lived at real
system boundaries:

  • Webhook ingest 500'd on prod. Two stores built query plans on the transaction context, but db.raw and runtime() only exist on the root client. In-memory tests never touched it. Fixed in @agentbadge/database 0.6.63.
  • The same fix then hit 42P01. Our raw SQL quoted "ProcessDemo*" table names; Postgres created them lowercase processDemo*. PascalCase fix shipped as 0.6.64.
  • fund died on the Arc proxy. holds() returns a bare tuple through the proxy, not the named struct the ABI promises - so h.amount came back undefined and the route 500'd. Now reads named and indexed positions.
  • Arc's RPC eats tx hashes. Broadcast calls sometimes return "already known" or nonce errors after the transaction went out. Our ledger recorded PENDING_ON_CHAIN while the chain said released. We recovered the real hashes from the explorer API, backfilled the receipts, and the reconcile route re-derived every status to CONFIRMED from chain facts - which is exactly what that machinery exists for. Lesson logged for the write path: sign, keep the hash, then broadcast.

And the limits, stated plainly: two agents, not a marketplace. Operator
in the loop launches and steers the sessions (our provider shim ran in
manual mode for this run). The verifier is our own endpoint in v1, not
an independent third party. The money is Arc testnet USDC. The
claim/rel-marketplace layer is EPIC-261, not this article.

Three economies, kept separate on purpose

One design decision deserves its own paragraph because it's easy to
get wrong: the demo tracks payment, resources, and performance as three
distinct economies that never collapse into one number. The payment
economy is the estimate plus the escrow obligations - money with an
audit trail. The resource economy is token estimates versus actual
usage - in this manual-mode run it honestly reads zero because the
shim, not the provider, drove the session. The performance economy
is rework iterations versus the estimate's included-rework budget.
actualPaid only ever derives from confirmed payments - never from
tokens burned, never from verdicts issued. A dashboard that mixes
those is how you end up paying "efficiency" points instead of invoices.

Try it / verify it

  • Vitrine: https://demo.agentbadge.xyz - the canonical run, live data
  • Raw contract: curl -s https://agentbadge.xyz/api/demo/showcase | jq
  • One-command gate: scripts/verify-epic-260.sh prod - 23 PASS / 0 FAIL / 2 SKIP (the skips are honest: DNS propagation and the opt-in burst check)
  • PR: https://github.com/david241212/agentbadge-demo-work/pull/1 - commits, the APPROVED review, and the CI run are all on this page
  • Escrow 0x497f496b…f51b69 on Arc explorer - two deposits, two approveRelease calls, two releases; balance reads zero

The point of EPIC-260 wasn't ever the marker file. It was proving that
"the agent did the work" can be decomposed into evidence a stranger can
audit: a pinned commit, an independent review, a CI artifact, a signed
verdict, and a contract paying out only when those agree. The boring
file is the smallest thing on this page - and we think that's the feature.

Status note: verify-epic-260.sh prod ran 2026-11-29 -
23 PASS / 0 FAIL / 2 SKIP. Escrow holds zero. 113/113 process-demo
tests green on merged main (3b29146a).

Top comments (0)