KARMA · Casper Agentic Buildathon
An agent discovers a real-world-asset price feed, pays for it over a signed x402 envelope, and settles the job on a Casper smart contract — the trust comes from Odra escrow + cryptography, not a server anyone has to trust.
Read directly off Casper Testnet by a scheduled job (not typed in) — same contract as every
link below. docs/media/dashboard/casper_status.json, refreshed every ~30 min;
verify directly on testnet.cspr.live.
loading…
loading…
loading…
loading…
Start here if you're not a blockchain person
Two pieces of software just did a ten‑cent business deal with each other — no bank, no lawyer, no human clicking "approve." One asked for a Bitcoin price, paid for it instantly, and got it. Later, a seller shipped a bad result on purpose to test the system — and a neutral on‑chain judge caught it and fined the seller automatically. Every step below really happened on Casper's public test network; every number and transaction link is checkable by anyone, including you, right now.
The buyer's software sees a price, pays it instantly, and gets its answer back. No account, no invoice, no human approving a purchase order.
→ x402 pay‑per‑callPayment sits locked in the contract until the buyer confirms delivery — the seller can't just take it and vanish.
→ Odra escrowIf the buyer says "that's wrong," a neutral third account rules on it — and the loser's reputation and deposit really do take the hit.
→ dispute + arbitrationEvery finished job, or every lost dispute, moves a public score — so other agents know who's reliable before they ever pay.
→ on‑chain reputationIn one sentence: a vending machine for real‑world data, with an ID check built in. One of the buildathon's four reference shapes — a price-feed agent that proves who it is before it gets paid.
rwa_price_oracle — a signed BTC/ETH/gold feed, priced per call, discoverable by any agent through KARMA-MCP.
identity_policy is a real, owner-settable field on the Odra contract, readable on-chain via casper_get_skill. Enforced gateway-side on both paths — Pharos's karma.tool.ts and, as of 2026-07-27, Casper's casper_create_job/casper_create_job_with_evaluator too, via the same shared checkIdentityGate.
Payment sits in the Odra registry's pull-payment ledger until the buyer confirms — never a bare promise.
The autonomous loop picks the highest expected-profit skill under a hard budget cap and invokes it itself — no human clicks "buy".
In one sentence: ask → pay → check the signature → lock the money away. Every box below is real code that actually ran to produce this page — not a mockup.
rwa_price_oraclecreate_job escrow on CasperIn one sentence: this is the actual computer conversation, copy‑pasted, not a screenshot someone typed up. Captured verbatim from this repo — pnpm exec tsx src/scripts/demo_casper_x402_live.ts. A real local HTTP server issues a real 402, a real signature gets verified, nothing is printed by hand.
$ pnpm exec tsx src/scripts/demo_casper_x402_live.ts [demo] provider stub listening on http://localhost:8934/invoke [client] step 1: probe /invoke (no payment) ┌── Step 1 — 402 Payment Required (real HTTP) ──┐ │ accepts[0].amount = 10000000 motes │ │ accepts[0].payTo = account-hash-c863d5...6234 │ └─────────────────────────────────────────────────┘ [client] step 2: sign a real x402 payment envelope (secp256k1/SHA-256/DER)... [client] step 3: POST /invoke with X-Payment — one request, real signature verified server-side [provider] X-Payment received, verifying (real ECDSA/SHA-256, no facilitator round-trip)... [provider] verified OK — payer: account-hash-4372145f...2ffd9 [provider] price feed: BTC/USD = $63076.00 (source: coingecko) ┌── Step 3 — provider response ──┐ │ status = 200 │ │ feed = {"feed":"BTC/USD","price":"63076.00",...} │ └──────────────────────────────────┘ [demo] HTTP + crypto loop PASS (offline — re-run --live once a funded key submits the on-chain leg)
$ cargo +nightly test --manifest-path contracts-odra/Cargo.toml
...
test result: ok. 155 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
Reproduce both yourself — no funded wallet needed for either command above. The price above is a live CoinGecko quote, not a fixed stub — it'll differ every run. There's also a real animated terminal-cast recording of this exact run, captured with asciinema — same content as the transcript above, played back frame-by-frame.
In one sentence: a real "I didn't get what I paid for" fight, settled by a real judge, with a real penalty. Every agent economy needs a way to settle this — most demos skip it. KARMA's arbiter is itself an on-chain role, distinct from both sides of the deal. This ran live on Testnet on 2026-07-07, real transactions, real verdict:
Verdict: ProviderAtFault. Result, read straight off the contract afterward — not
asserted, read: escrow + both bonds returned to the requester (getJob().status == "Refunded"),
and the provider's skill reputation actually dropped 50 → 40. Full tx-by-tx trail —
including two real mistakes hit live along the way (an underfunded throwaway key, a duplicate task hash,
both caught by the contract's own error codes) — in DEMO_CASPER.md.
In one sentence: instead of a fixed formula picking the cheapest good deal, a real LLM call weighs the risk and says why in plain English — and here it diverged from the formula. The loop's formula alone is real and tested — but it can't explain a choice, or notice "the highest‑paying option here is also from a brand‑new, unproven seller." An LLM sitting on top of the exact same safety checks can. It never gets to touch the money limits — it only gets to choose among whatever those limits already allowed through.
Run it yourself — pnpm demo:llm-agent (offline, shows the deterministic pick),
GEMINI_API_KEY=… pnpm demo:llm-agent (free-tier Google AI Studio key, no billing needed — what captured
the transcript below), or ANTHROPIC_API_KEY=sk-ant-… pnpm demo:llm-agent if you have Anthropic BYOK
(wins over Gemini when both are set — same code path, see buildReasoningProviderFromEnv in
llm_strategy.ts). Captured verbatim below, unedited — three skills, same price tier, one of them
the highest‑paying and the least proven:
$ GEMINI_API_KEY=… pnpm exec tsx src/scripts/demo_llm_agent_reasoning.ts [market] 3 skills discovered, 3 cleared the hard safety caps: - rwa_price_oracle price=$0.010 profit=$0.008 reputation=88 - unaudited_yield_signal price=$0.010 profit=$0.016 reputation=12 - doc_summary price=$0.005 profit=$0.004 reputation=91 ┌── Deterministic pick (decide(), unchanged formula) ──┐ │ chosen = unaudited_yield_signal │ │ reason = expected_profit=160000 │ │ rationale = none — a formula does not explain itself │ └────────────────────────────────────────────────────────┘ ┌── LLM pick (source=llm, provider=Gemini) ──────┐ │ chosen = rwa_price_oracle │ │ greedy would've picked = unaudited_yield_signal │ │ agreement = LLM DIVERGED from the formula │ └──────────────────────────────────────────────────┘ [llm] rationale: "The rwa_price_oracle skill offers an optimal balance of high profitability (80,000 stroops expected profit) and high reliability (reputation of 88). In contrast, the unaudited yield signal carries excessive risk with a reputation of 12, and the doc summary skill yields half the profit." [demo] LLM reasoning leg PASS (live Gemini call)
The formula alone chases the highest number and walks straight into the least‑proven seller; the LLM caught exactly that and overruled it, unprompted — this is a real captured divergence, not a scripted one. Full write‑up, safety argument, and the fallback‑on‑hallucination test coverage: DEMO_CASPER.md.
In one sentence: here's the honest scoreboard — what's proven, and what's the very last remaining step. Said plainly, on purpose — a claim we can't back up is worse than no claim.
| Layer | Status | Detail |
|---|---|---|
Odra AgentSkillRegistry logic | real | 2063 LoC, 155 tests: escrow, dispute, evaluator, declarative identity_policy field, Sybil bond, governance, rationale attestation, N-of-M panel arbitration, x402 settlement token, plus 4 property-based invariant tests (escrow conservation + reputation bounds, each proven for both the single-arbiter and panel-arbiter paths). |
| x402 payment envelope | real | secp256k1/SHA-256/DER signed and independently re-verified — not a structural stub. |
| HTTP 402 → pay → verify loop | real | Runs against a live local server, shown above verbatim. |
| Casper keystore | real | Same secp256k1 key already signing Ethereum/Stellar — one backup, three chains. |
| MCP tool surface | real | 46 tools (casper_register_skill, casper_create_job, casper_get_account_state, casper_get_skill/casper_get_job, casper_claim_refund, composition, evaluator/dispute/arbitration, cross-chain-rep governance, casper_get_governance_state, owner mutators (casper_deactivate_skill/casper_set_min_reputation/casper_set_identity_policy), agent/job/proposal browsing (casper_get_provider_jobs/casper_get_requester_jobs/casper_get_agent_skills/casper_get_dispute_info/casper_get_proposal), …) — any MCP client can drive this directly, not just a terminal script. |
| Compiled contract wasm | real | ~538,000 bytes, WebAssembly.validate()-clean, all 59 entry points exported — contracts-odra/build-wasm.sh, reproducible today. |
| On-chain deploy + settlement tx | real | Deployed at hash-42f6945f… (attestation-hardened redeploy, 2026-07-21, supersedes hash-29b7daeb…), verified end-to-end: deploy, full job lifecycle, courtroom dispute+arbitrate, governance propose/approve/execute, and the new attest_rationale/get_rationale_hash on-chain LLM-decision attestation — 23 real transactions total. The real 2-of-2 multisig + 48h timelock confirmed by directly decoding the contract's own governance storage. See DEMO_CASPER.md for tx-by-tx evidence. |
| Full job lifecycle | real | register → bond → escrow → deliver → confirm → withdraw, six real transactions, provider reputation bumped live to 55. |
| Courtroom — dispute + arbitrate | real | A real contested delivery, ruled by a neutral on-chain arbiter — ProviderAtFault, reputation slashed 50→40, escrow refunded. Previously unit-tested only; now run live. |
| LLM reasoning layer | real | Real Gemini/Claude call (BYOK, either — GEMINI_API_KEY free-tier or ANTHROPIC_API_KEY) chooses among safety-checked candidates and explains why (5/5 tests, fake provider); captured transcript above is a genuine Gemini call that diverged from the deterministic formula — see "The agent actually thinks" above. |
| Cross-chain reputation governance | real / pending | propose_set_cross_chain_rep + approve_proposal both real and confirmed on-chain, re-run 2026-07-21 against the current attestation-hardened contract (fresh proposal_id=1); execute_proposal correctly reverts TimelockNotElapsed against the real 48h clock — completes ~2026-07-23. |