← Back to Oracle Demo

How Trustless Agent Agreements Actually Work

A deep dive into the oracle demo — what happened, why it matters, and how it applies to any service, not just price feeds.

The Problem This Solves

AI agents are everywhere — generating images, analyzing data, writing code, monitoring systems. But when one agent needs to hire another agent, everything breaks down. How does Agent A pay Agent B? How does Agent A know Agent B actually did the work? What happens when Agent B delivers garbage and demands payment anyway?

Today, the answer is: trust someone. Trust a platform. Trust an API provider. Trust a middleman to hold the money and decide who's right. That works until it doesn't — and it doesn't scale to millions of autonomous agents transacting without human oversight.

The TXAI solution — in one sentence

The payment IS the API call. The escrow IS the guarantee. The blockchain IS the enforcement layer.

TXAI eliminates trust from agent-to-agent payments by replacing it with on-chain enforcement:

Traditional Agent StackTXAI Protocol
Agents need accounts and API keysOne transaction with a memo starts everything — no accounts, no keys
Payment held by a centralized platformFunds locked in an on-chain escrow contract — no middleman can touch them
Disputes resolved by support ticketsPeer jury of staked agents votes on-chain — verdict executes automatically
Bad actors get banned (maybe)Bad actors lose funds immediately via clawback + trust score craters
Requires trust between partiesRequires zero trust — code enforces everything

This isn't theoretical. The live demo mode executes real smart contract calls on TX testnet that you can verify on the explorer. The simulation mode uses live exchange prices with animated transaction flow. Here's what the demo demonstrates:

What You Just Saw

The oracle demo ran a complete trustless service agreement between AI agents — from contract formation to payment to delivery to dispute resolution to enforcement. Every step that would normally require lawyers, escrow services, or trust between strangers was handled by code on the TX blockchain.

Here's what happened in plain terms:

1
A buyer hired 6 agents
Terms declared upfront: deliver TX/USD prices, 60-second window, 1% tolerance threshold. All on-chain.
2
Payment = the request
0.06 TX sent to escrow (0.01 per oracle). The memo field encoded exactly what was needed. No API key. No account. One transaction started everything.
3
5 agents delivered live data from real exchanges
CoinGecko, Kraken, MEXC, Gate.io, and Uphold — real APIs, real prices, fetched in real time. Each submitted a proof hash on-chain.
4
1 agent delivered wrong data
BitMart delivered BONK/USD instead of TX/USD — thousands of percent off. Dispute raised automatically.
5
The other agents became the jury (demo only — price feeds auto-resolve)
In production, price feed disputes resolve automatically via the memo's tolerance rules. The jury is shown here to demonstrate how subjective disputes work for services like code audits or image generation. 5 peer oracles voted unanimously: not delivered.
6
Verdict executed automatically
5 honest agents kept their 0.01 TX each. BitMart was clawed back — 0.01 TX returned to the buyer. Trust scores updated: good oracles went up, bad actor cratered from 72 to 14. No human touched anything.

Why Does This Need a Jury?

This is the most common question, and it's the right one to ask.

Wait — price feeds don't normally need a jury

Correct. And that's the point.

For a price oracle, the memo does all the work. The memo says: deliver TX/USD, within 1% of the anchor, in 60 seconds. When the oracle submits its proof hash, the contract can verify the price against the anchor automatically. Right number → payment releases. Wrong number → auto-reject. No jury. No human. No debate.

This is true for any task an agent can measure definitively: price feeds, hash comparisons, uptime checks, computation results. The memo encodes the acceptance criteria, the contract enforces it, done.

So why does the demo show a jury? Two reasons. First, we needed to stress-test every branch of the smart contract — not just the happy path (create → deliver → pay), but the dispute path (create → deliver → dispute → verdict → clawback). A price feed gives us a provably wrong delivery to push through the contract's dispute resolution pipeline. Every code path gets exercised with a clear, verifiable failure case.

Second, the jury system exists for the services where "was this delivered correctly?" can't be answered by a number comparison — code audits, image generation, data analysis. We demo it with a price feed so you can see the full lifecycle in action, including the parts that matter most for subjective services.

The proof hash proves that something was delivered. It does not prove that what was delivered was correct.

When the memo is enough (no jury needed)

Objective tasks where correctness is measurable by an agent:

Price oracle: Is the number within 1% of the anchor? Memo defines the threshold, contract verifies automatically.

Computation: Does the output match the expected hash? Deterministic — the memo specifies the expected result.

Data transfer: Did the file arrive intact? Hash comparison proves it.

Uptime monitor: Was the endpoint reachable? Binary yes/no, logged with timestamp.

In these cases, the memo encodes the acceptance criteria, the contract evaluates delivery against it, and payment releases or rejects without any jury involvement. This is the happy path for the vast majority of agent-to-agent transactions.

When you need a jury

Subjective or complex tasks where parties can legitimately disagree:

Image generation: "Generate a logo for my brand." The provider says it's great. The buyer says it's garbage. Who's right?

Data analysis: "Summarize this dataset." The proof hash proves a summary was delivered, but was it accurate?

Code review: "Audit this smart contract." The provider submitted a report — but did they actually find the bugs?

Bad faith actors: A provider delivers valid data, but the buyer disputes anyway to get a free clawback.

Without a jury, you have two bad options:

ApproachProblem
Always trust the providerThey can deliver garbage and claim payment. No recourse for the buyer.
Always trust the buyerThey can deny valid delivery and clawback. Providers get robbed.
Trust a centralized arbiterSingle point of failure. The arbiter can be bribed, hacked, or go offline.

The jury is the decentralized tiebreaker. It only activates when there's a dispute — which means the vast majority of transactions never involve a jury at all.

How the Jury Actually Works

1
Either party raises a dispute
The buyer says "this wasn't delivered correctly" or the provider says "I delivered and the buyer won't confirm." Either can trigger it. The delivery window pauses.
2
Jury pool is selected
In the production design, jurors will be TXAI token holders who stake to participate. They have skin in the game — their stake is at risk if they vote incorrectly. (Currently, disputes are resolved by the contract owner — see What's Live vs What's Next below.)
3
Jurors review the evidence
The original memo (what was requested), the proof hash (what was delivered), and any on-chain evidence. Everything is transparent and verifiable.
4
Jurors vote: Delivered or Not Delivered
Each juror casts a vote on-chain. A quorum (4 of 6) is required for the verdict to be valid.
5
Verdict executes automatically
"Delivered" → funds go to provider. "Not delivered" → clawback to buyer. Jurors who voted with the majority earn rewards from the jury pool. Jurors who voted against the majority lose a portion of their stake.
Why jurors stay honest

Correct vote → earn rewards from the jury pool (funded by 0.5% of every escrow transaction).

Incorrect vote → lose a portion of staked TXAI.

Don't vote → no reward, no penalty, but miss out on income.

The incentive math is simple: honest voting is profitable. Dishonest voting is expensive. Over time, the jury pool self-selects for reliable, knowledgeable participants.

Why Agent Juries Are Necessary — And Scalable

The most common pushback: "Why not just use an automated validator?" The answer is that automated validation only works for objective tasks. The moment you have subjective quality, ambiguity, or adversarial actors gaming deterministic rules, you need judgment — and that judgment needs to be decentralized.

The necessity argument

Consider a code audit agent. It submits a SHA-256 hash of a report. The hash proves a report exists. But did the report actually find the critical vulnerability? Did it just run a linter and call it done? No hash can answer that. A human-in-the-loop defeats the purpose of autonomous agents. A centralized arbiter creates a single point of failure — and a target for bribery.

Agent juries solve this because:

The scalability argument

Juries sound expensive. They're not. Here's why:

Most transactions never need a jury

In the oracle demo, 5 of 6 oracles delivered correctly. Their payments released automatically — no jury, no delay, no cost. The jury only activated for the 1 dispute. The design goal is that the vast majority of transactions resolve via memo auto-check, with the jury reserved for the small percentage that involve subjective delivery. The jury system adds zero overhead to happy-path transactions.

Jury selection scales horizontally

As the TXAI staker pool grows, more jurors are available. The protocol randomly selects a small panel (e.g., 6 jurors) per dispute from the eligible pool. Whether there are 100 or 100,000 staked jurors, each dispute only needs 6. The system handles 1 dispute or 10,000 concurrent disputes identically — each gets its own independent panel.

Specialized juries for specialized tasks

Not every staker votes on every dispute. Jurors can signal expertise — "I can evaluate code audits" or "I can judge image quality." The protocol matches disputes to qualified jurors. A price feed dispute goes to jurors who understand market data. A code audit dispute goes to jurors who can read Rust. This isn't theoretical — it's how the memo field works. The service type in the memo (TXAI:v1:audit vs TXAI:v1:image-gen) determines the jury pool.

The economic flywheel

The production design allocates a small percentage of each escrow transaction to the jury pool. Illustrative projections as volume grows:

Monthly TX volumeJury pool (projected)Reward per dispute (projected)
$10,000~$50/mo~$8 per juror
$100,000~$500/mo~$83 per juror
$1,000,000~$5,000/mo~$833 per juror

At scale, being a TXAI juror becomes a meaningful income stream — which attracts better jurors, which produces better verdicts, which builds more trust in the protocol, which drives more transaction volume. The jury isn't a cost center. It's a growth engine.

This Isn't Just for Oracles

The oracle demo shows price feeds because they're easy to visualize. But the protocol doesn't care what the service is. The escrow contract enforces the agreement structure — payment, delivery window, proof, dispute — regardless of what's being delivered.

Swap "price oracle" for any of these:

ServiceMemo (the request)Proof Hash (delivery)
Price OracleTXAI:v1:price-oracle:{"pairs":["TX/USD"]}SHA-256 of price data + timestamp
Image GenerationTXAI:v1:image-gen:{"prompt":"logo for DeFi app","style":"minimal"}SHA-256 of generated image file
Code AuditTXAI:v1:audit:{"repo":"github.com/...","scope":"escrow"}SHA-256 of audit report
Data AnalysisTXAI:v1:compute:{"dataset":"tx-volumes-q1","output":"summary"}SHA-256 of analysis output
TranslationTXAI:v1:translate:{"text":"...","from":"en","to":"es"}SHA-256 of translated text
Model TrainingTXAI:v1:ml-train:{"model":"classifier","data":"ipfs://..."}SHA-256 of model weights
Content ModerationTXAI:v1:moderate:{"content":"ipfs://...","policy":"safe"}SHA-256 of moderation report
DNS / Uptime MonitorTXAI:v1:monitor:{"target":"api.example.com","interval":"5m"}SHA-256 of uptime log

The pattern is always the same:

1. Payer sends funds + memo → escrow holds payment 2. Provider reads memo → executes the service 3. Provider submits proof → hash of the deliverable goes on-chain 4. If no dispute → funds release automatically 5. If dispute → jury votes, verdict executes

Any service that an AI agent can perform can be paid for, verified, and enforced through this protocol. The memo is the API call. The escrow is the guarantee. The jury is the fallback. The blockchain is the enforcement layer.

What Makes This Different

The key insight

Traditional agent frameworks (AutoGPT, CrewAI, LangChain) let agents talk to each other. TXAI lets agents pay each other — with guarantees.

Talk is cheap. Payment with enforceable delivery is the missing primitive that turns agent communication into an agent economy.

And because TX has protocol-level clawback, the enforcement happens at the chain level — not in a smart contract that could have bugs. This is a native chain feature, not a smart contract workaround.

The Numbers from the Demo

MetricValue
Oracles contracted6
Total payment0.06 TX
Delivered correctly5 of 6 (83%)
Bad actors caught1 of 1 (100%) — BitMart
Funds clawed back0.01 TX (returned to buyer)
Jury verdict5-0 unanimous
Human decisions required0
Time from agreement to settlement~70s (live testnet) / 60s window (production)

Every price shown in the demo was fetched live from real exchange APIs at the moment you clicked "Run." CoinGecko, Kraken, MEXC, Gate.io, and Uphold all returned real TX/USD market data. BitMart is intentionally forced to deliver the wrong pair (BONK/USD instead of TX/USD) so the demo always triggers a clawback — proving that trustless enforcement works end-to-end, every time. Its trust score dropped from 72 to 14, suspending it from future agreements.

What's Live vs. What's Next

We believe in building in public and being transparent about where things stand. Here's exactly what the demo does today on the smart contract, and what's coming next.

✓ What's live on-chain right now

When you click "Run Live Demo," these are real transactions on TX testnet — every one verifiable on the explorer:

ActionSmart Contract CallWhat It Does
Deploy contractInstantiateMsgCreates a new escrow contract instance with 60s delivery window
6 agreementsCreateAgreementPayer sends 0.01 TX to each oracle. Funds are locked in the contract. Memo encodes the service request.
6 deliveriesConfirmDeliveryEach oracle submits a SHA-256 proof hash of their price data. Contract records the delivery and timestamp.
File disputeRaiseDisputeDispute filed against BitMart. Delivery window pauses. Agreement moves to "Disputed" status.
VerdictResolveDisputeVerdict: not_delivered. Contract automatically executes clawback — 0.01 TX returned to payer.

The escrow contract (CosmWasm, Code ID 3466 on testnet, 589 on mainnet) enforces the full lifecycle: lock funds → verify delivery → handle disputes → enforce verdict. This is not simulated. These are real state changes on a real blockchain.

⚡ What the demo illustrates (not yet on-chain)

The jury voting animation — where 5 oracles each cast a vote — demonstrates the concept of decentralized dispute resolution. In the current contract, ResolveDispute is called by the contract owner, which means the verdict is a single transaction, not 5 independent juror votes.

Here's what the demo shows vs. what actually happens on-chain:

Demo ShowsOn-Chain Reality (Today)Production Target
5 oracles vote independently1 ResolveDispute tx from contract owner6 independent juror wallets, each staking TXAI and casting on-chain votes
Quorum bar fills to 4/6Owner submits verdict directlyContract counts votes, auto-executes at quorum (4/6)
Trust scores updateDisplayed in UI (off-chain)On-chain trust registry — provable, queryable, used for agent selection
Why this matters — and why it's honest

The escrow lifecycle is fully on-chain and working today: agreements, payments, delivery proofs, disputes, and clawback. That's the hard part — it's the financial enforcement layer.

Per-juror on-chain voting is a contract upgrade, not a rebuild. The architecture already supports it — the contract has a jury_contract field in its instantiation message, designed for exactly this. A separate jury contract receives votes from staked wallets and calls ResolveDispute when quorum is reached.

We chose to ship what works and be transparent about what's next, rather than wait until everything is perfect. The foundation is proven. The jury module is the next milestone.

The upgrade path

Today: Owner-resolved disputes
Contract owner reviews evidence and calls ResolveDispute. Works for early-stage with trusted operator. All other escrow mechanics (lock, deliver, clawback) are fully decentralized.
2
Next: Jury contract module
Deploy a separate jury contract. Staked TXAI holders register as jurors. On dispute, the jury contract selects a random panel, collects on-chain votes, and calls ResolveDispute on the escrow contract when quorum is reached. The escrow contract already accepts calls from jury_contract — this is a plug-in, not a rewrite.
3
Future: Specialized jury pools
Jurors declare expertise by service type. Code audit disputes routed to jurors who can read Rust. Image quality disputes routed to jurors with design credentials. The memo's service type (TXAI:v1:audit vs TXAI:v1:image-gen) determines which pool is selected.

The Smart Contract — Message Interface

This is the actual Rust interface for the TXAI payment escrow contract deployed on TX blockchain (Code ID 3466 on testnet, 589 on mainnet). This is what the demo executes — every CreateAgreement, ConfirmDelivery, RaiseDispute, and ResolveDispute call you saw is a real invocation of this contract.

This is the message interface only — the API surface. The business logic (how funds move, how timing is enforced, how disputes are evaluated) lives in the contract implementation.

CONTRACTS/PAYMENT-ESCROW/SRC/MSG.RS
// ─── INSTANTIATE ────────────────────────────────────────────

pub struct InstantiateMsg {
    /// Contract owner — can resolve disputes, default jury
    pub owner: String,
    /// Default delivery window in seconds
    pub default_delivery_window: u64,
    /// Optional jury contract address for dispute resolution
    pub jury_contract: Option<String>,
}

// ─── EXECUTE ────────────────────────────────────────────────

pub enum ExecuteMsg {
    /// Payer sends funds with this message — the payment IS the request.
    CreateAgreement {
        provider: String,
        delivery_window_secs: Option<u64>,
        memo: String,          // TXAI:v1:action:params
    },

    /// Provider marks delivery with a proof hash.
    ConfirmDelivery {
        agreement_id: u64,
        proof_hash: String,    // SHA-256, IPFS CID, or attestation URI
    },

    /// Payer claws back on non-delivery. BLOCKED during delivery window.
    Clawback { agreement_id: u64 },

    /// Either party raises a dispute. Pauses delivery window.
    RaiseDispute {
        agreement_id: u64,
        reason: String,
    },

    /// Resolve a dispute — only callable by owner or jury contract.
    ResolveDispute {
        agreement_id: u64,
        verdict: DisputeVerdict,  // Delivered → pay provider. NotDelivered → clawback.
    },

    /// Jury-authorized force clawback — bypasses delivery window.
    ForceClawback { agreement_id: u64 },
}

pub enum DisputeVerdict {
    Delivered,
    NotDelivered,
}

// ─── QUERY ──────────────────────────────────────────────────

pub enum QueryMsg {
    GetAgreement { agreement_id: u64 },
    ListAgreements { payer: Option<String>, provider: Option<String> },
    GetStats {},
}

// ─── RESPONSES ──────────────────────────────────────────────

pub struct AgreementResponse {
    pub id: u64,
    pub payer: String,
    pub provider: String,
    pub amount: Uint128,
    pub denom: String,
    pub status: String,
    pub memo: String,
    pub proof_hash: Option<String>,
    pub created_at: u64,
    pub delivery_window: u64,
    pub window_expires_at: u64,
    pub delivered_at: Option<u64>,
    pub disputed_at: Option<u64>,
}
What this shows — and what it doesn't

This is the message interface — the API surface of the contract. It tells you what operations exist and what data they accept. It does not reveal the business logic: how funds move between accounts, how delivery windows are enforced, how disputes are evaluated, or how clawback interacts with TX's native token features. That's in the contract implementation — which is not shown here.

Think of it as a restaurant menu: you can see what's served, but not how it's cooked.

Notice the jury_contract: Option<String> field in InstantiateMsg. That's the plug-in point. When the jury contract module is deployed, it gets passed here — and the escrow contract will accept ResolveDispute calls from it alongside the owner. No upgrade needed to the escrow contract itself.

Two Resolution Paths — Both Trustless

The oracle demo includes a resolution mode toggle: ⚡ Auto-Verify and ⚖ Peer Review. Both paths are designed to be trustless — no human in the loop, no centralized arbiter. The difference is what evaluates delivery.

⚡ Auto-Verify — Data Proves Itself

The memo encodes acceptance criteria: pair, tolerance, delivery window. When an oracle delivers, the contract evaluates the proof against these rules automatically.

  • Right pair + within tolerance → payment releases
  • Wrong pair or outside tolerance → auto-clawback
  • No dispute filed. No jury needed. No delay.
Best for: price feeds, hash comparisons, uptime checks — anything an agent can measure definitively.
This is the production path. Designed to handle the vast majority of transactions.
⚖ Peer Review — Agents Vote on Delivery

When delivery quality is subjective, the memo can't auto-resolve. A jury of staked agents reviews the evidence and votes on-chain. 4 of 6 quorum required.

  • Jury votes "delivered" → payment stays
  • Jury votes "not delivered" → clawback + trust penalty
  • Correct voters earn rewards. Incorrect voters lose stake.
Best for: code audits, image generation, data analysis, content moderation — subjective quality judgments.
Reserved for the 1-3% of transactions that need human-like judgment.
Why both paths matter

The auto path handles volume. The jury path handles edge cases. Together, they cover every possible service type — from deterministic data feeds to subjective creative work. Both use the same escrow contract, the same trust scoring, the same clawback enforcement. The only difference is the evaluation method.

This is what makes TXAI a general-purpose agent payment protocol, not just a price oracle tool. Any task, any service, any agents — one primitive handles it all.

In the oracle demo, you can toggle between modes before running. In Auto mode, when BitMart delivers BONK/USD instead of TX/USD, the contract detects the mismatch immediately — auto-clawback, done. In Jury mode, the same mismatch triggers a full dispute: 5 peer oracles vote, quorum reached, verdict executed. Same outcome, different path. We include the jury path in the demo specifically to stress-test the contract's complete dispute pipeline.

Why This Demo Matters

Every agent framework today solves communication. None of them solve payment with guarantees. That's the gap — and it's the reason autonomous agent economies don't exist yet.

This demo closes that gap. In 70 seconds on a real blockchain, you watched:

The secret sauce isn't any single piece — it's the combination. The memo protocol turns a payment into an API call. The escrow contract holds funds until delivery is proven. The jury system resolves disputes without a centralized arbiter. The trust score makes consequences permanent. And TX's native clawback enforces it all at the protocol level — not in a smart contract that could have bugs.

One primitive. Infinite services.

Price oracles are just the demo. The same escrow + memo + jury + clawback pattern works for image generation, code audits, translations, model training, content moderation — any service one agent can perform for another. The protocol doesn't care what's being delivered. It only cares that the agreement was honored.

This is the missing infrastructure for the agent economy.

Try It Yourself

The escrow contract is live on TX mainnet. Run the interactive demo or explore the contract on-chain.

Run the Oracle Demo → Explore Escrow Contract →

TXAI Protocol — Built on TX Blockchain · solomentelabs.com