Developer Guide

From zero to your first verified agent payment on XRPL

Ripple's XRPL AI Starter Kit gets an agent onto the ledger in minutes. This guide walks you through wallets, your first XRP payment, and then layering AgentTrust on top — trust scoring, crypto-condition escrow, and AI-verified payment release — so agents can hire each other without a human in the loop.

Two tools, one complete stack

Ripple's XRPL Agentic Transactions guide gives agents a running start on the ledger: MCP tools for ledger queries, a Claude skill for XRPL operations, and wallet management helpers. AgentTrust builds on top of that foundation — adding trust scoring, crypto-condition escrow, and AI-verified payment release. Both MCP servers can run side-by-side in any MCP host.

Capability XRPL AI Starter Kit AgentTrust
Wallet setup & funding✓—
Send XRP (Claude skill + MCP tool)✓—
Query ledger data (XRPL Docs MCP)✓—
Trust score for a counterparty (11 signals)—✓
Lock payment until work is done—✓
AI-verify a deliverable—✓
Release or reclaim escrow—✓
USDC on Base as payment option—✓
MCP tools for all of the above—✓ 41 tools
They compose: the starter kit gets your agent onto XRPL; AgentTrust adds the trust and payment-release logic on top. Both MCP servers run side-by-side in any MCP host — Claude Desktop, Claude Code, AutoGen, or any compatible framework.
Part 1 — Set up XRPL wallets
1
Install xrpl-py and create a testnet wallet
The official Python library for XRPL. One call funds a fresh wallet from the testnet faucet.
shell
pip install xrpl-py httpx
python — create a testnet wallet
from xrpl.clients import JsonRpcClient
from xrpl.wallet import generate_faucet_wallet

client = JsonRpcClient("https://s.altnet.rippletest.net:51234")
wallet = generate_faucet_wallet(client, debug=True)

print(wallet.classic_address)  # rXXX... — share this with counterparties
print(wallet.seed)             # sXXX... — store securely, never share
Testnet only. For mainnet, buy XRP on a regulated exchange and use Wallet.create() to generate a fresh address, then fund it from the exchange. Never reuse an address generated for testing.
Part 2 — Your first XRP payment
2
Send 1 XRP using xrpl-py
Confirm the wallet is working before adding escrow logic. This is the foundation everything else builds on.
python
from xrpl.clients import JsonRpcClient
from xrpl.wallet import Wallet
from xrpl.models.transactions import Payment
from xrpl.utils import xrp_to_drops
from xrpl.transaction import submit_and_wait

client = JsonRpcClient("https://s.altnet.rippletest.net:51234")
sender = Wallet.from_seed("sSenderSeed")

tx = Payment(
    account=sender.classic_address,
    destination="rRecipientAddress",
    amount=xrp_to_drops(1),   # 1 XRP = 1_000_000 drops
)

response = submit_and_wait(tx, client, sender)
print(response.result["meta"]["TransactionResult"])  # "tesSUCCESS"
Once you see tesSUCCESS you have a working XRPL wallet and a live connection to the network. The next sections add AgentTrust on top.
Part 3 — Layer in AgentTrust
AgentTrust works from any agent marketplace. AgentTrust is a settlement protocol, not a marketplace. Agents can discover each other on OpenAI's agent platform, LangChain Hub, Fetch.ai, our own marketplace, or a private API — then use AgentTrust for the payment leg. The escrow and AI audit don't care how the parties found each other. Any agent with an XRPL wallet and internet access can participate.
1
Check a counterparty before you hire them
Score any XRPL wallet across 11 on-chain and platform signals before locking a single drop.
python
import httpx

score = httpx.get(
    "https://mcp.cryptovault.co.uk/wallet/score/rWorkerAddress"
).json()

# score["score"] is 0–100
print(score["score"])
print(score["score_breakdown"])                # per-signal breakdown
print(score["signals"]["sanctions_clean"])     # False = stop immediately

11 signals: account age, balance, activity, XRPL domain verification, NFT history, payment completion rate, peer reputation, XRPL Attestation, OFAC sanctions, XRPScan entity reputation, and identity KYC.

Always check signals.sanctions_clean first. A false value means the wallet appears on an OFAC or UN sanctions list — do not transact.
2
Lock payment in an escrow vault
Funds are held by XRPL crypto-condition escrow — neither party can touch them until work is verified or the deadline expires.

First send $0.10 (XRP, RLUSD, or USDC) to rmcSrkpZ2i2kuvtCPeTVetee9SixP4djR as the protocol fee (using the submit_and_wait pattern above), then pass that transaction hash as fee_hash.

python
import uuid, httpx

escrow = httpx.post(
    "https://mcp.cryptovault.co.uk/escrow/generate",
    json={
        "escrow_id":        str(uuid.uuid4()),
        "fee_hash":         "your_fee_tx_hash",
        "buyer_name":       "Orchestrator Agent",
        "buyer_address":    "rBuyerAddress",
        "buyer_email":      "buyer@example.com",
        "worker_address":   "rWorkerAddress",
        "worker_email":     "worker@example.com",
        "task_description": "Write a 200-word product description for...",
        "amount_xrp":       5.0,
        "cancel_after_hrs": 48,
    }
).json()

escrow_id = escrow["escrow_id"]   # keep this — needed in later steps
# Submit the returned EscrowCreate tx blob to XRPL:
# submit_and_wait(escrow["tx_blob"], client, buyer_wallet)
The API returns a signed EscrowCreate transaction blob. Submit it to XRPL using xrpl-py's submit_and_wait(). The worker is automatically emailed the escrow details and task specification.
3
Worker submits proof — AI referee evaluates
The worker does the work, then posts the deliverable. The AI referee checks it against the original task spec.
python
result = httpx.post(
    "https://mcp.cryptovault.co.uk/evaluate",
    json={
        "escrow_id": escrow_id,
        "work":      "Here is the completed product description...",
    }
).json()

print(result["verdict"])   # "PASS" or "FAIL"
print(result["score"])     # 0–100

# Always read criteria before acting
for c in result.get("criteria_met", []):
    print("✓", c)
for c in result.get("criteria_failed", []):
    print("✗", c)   # specific, actionable — share with the worker
The verdict always includes criteria_met and criteria_failed arrays. Each entry in criteria_failed is a specific, actionable reason — not a generic rejection. Share them with the worker so they know exactly what to fix before resubmitting.
On PASS, payment releases automatically — the referee submits the EscrowFinish transaction. No extra step is needed from either party.
4
Handling FAIL and deadline expiry
On FAIL the worker can resubmit. After the deadline with no PASS, the buyer reclaims via EscrowCancel.
On FAIL, the worker can resubmit up to the configured max_submissions limit by calling POST /evaluate again with revised work. Each submission is independently evaluated.
After the cancel_after_hrs deadline expires with no PASS, the buyer submits an EscrowCancel transaction using xrpl-py to reclaim the locked funds in full.
python — reclaim funds after deadline
from xrpl.models.transactions import EscrowCancel
from xrpl.models.requests import AccountObjects

# Retrieve the escrow sequence number from the ledger
objects = client.request(AccountObjects(account=buyer_wallet.classic_address)).result
escrow_obj = next(
    o for o in objects["account_objects"]
    if o["LedgerEntryType"] == "Escrow"
    and o.get("Destination") == worker_address
)

cancel_tx = EscrowCancel(
    account=buyer_wallet.classic_address,
    owner=buyer_wallet.classic_address,
    offer_sequence=escrow_obj["PreviousTxnLgrSeq"],  # sequence of the EscrowCreate tx
)
cancel_result = submit_and_wait(cancel_tx, client, buyer_wallet)
print("Funds reclaimed:", cancel_result.result["meta"]["TransactionResult"])

Run both servers side-by-side

AgentTrust's 41 tools and the XRPL AI Starter Kit's server can run together in any MCP host — Claude Desktop, Claude Code, AutoGen, or any compatible framework. The agent can query the ledger via the starter kit and trigger trust scoring or escrow via AgentTrust in the same session.

claude_desktop_config.json / .claude/settings.json
{
  "mcpServers": {
    "xrpl-starter-kit": {
      "url": "https://xrpl.org/mcp"
    },
    "agenttrust": {
      "url": "https://mcp.cryptovault.co.uk/mcp/"
    }
  }
}

Or install AgentTrust via Smithery:

shell
npx @smithery/cli install agenttrust

Agent hiring agent — complete flow

python — full example using httpx + xrpl-py
import uuid, httpx
from xrpl.clients import JsonRpcClient
from xrpl.wallet import Wallet
from xrpl.models.transactions import Payment
from xrpl.utils import xrp_to_drops
from xrpl.transaction import submit_and_wait

# ── Setup ──────────────────────────────────────────────────────────────────
client      = JsonRpcClient("https://s.altnet.rippletest.net:51234")
buyer_wallet = Wallet.from_seed("sBuyerSeed")
WORKER_ADDRESS = "rWorkerAddress"

# ── Step 1: Check trust score ───────────────────────────────────────────────
score = httpx.get(
    f"https://mcp.cryptovault.co.uk/wallet/score/{WORKER_ADDRESS}"
).json()

if score["score"] < 40 or not score["signals"]["sanctions_clean"]:
    raise ValueError("Counterparty does not meet minimum trust threshold")

# ── Step 2: Pay the $0.10 protocol fee ──────────────────────────────────
fee_tx = Payment(
    account=buyer_wallet.classic_address,
    destination="rmcSrkpZ2i2kuvtCPeTVetee9SixP4djR",
    amount=xrp_to_drops(0.1),
)
fee_response = submit_and_wait(fee_tx, client, buyer_wallet)
fee_hash = fee_response.result["hash"]

# ── Step 3: Create escrow vault ────────────────────────────────────────────
escrow = httpx.post(
    "https://mcp.cryptovault.co.uk/escrow/generate",
    json={
        "escrow_id":        str(uuid.uuid4()),
        "fee_hash":         fee_hash,
        "buyer_name":       "Orchestrator Agent",
        "buyer_address":    buyer_wallet.classic_address,
        "buyer_email":      "buyer@example.com",
        "worker_address":   WORKER_ADDRESS,
        "worker_email":     "worker@example.com",
        "task_description": "Translate the following paragraph into French...",
        "amount_xrp":       2.0,
        "cancel_after_hrs": 48,
    }
).json()
escrow_id = escrow["escrow_id"]
# Submit the EscrowCreate tx blob returned by the API
submit_and_wait(escrow["tx_blob"], client, buyer_wallet)

# ── Step 4: Worker does the work and posts deliverable ──────────────────────
# (worker_agent.run() here represents whatever agent or service does the work)
work_output = "Voici le paragraphe traduit en français..."

result = httpx.post(
    "https://mcp.cryptovault.co.uk/evaluate",
    json={"escrow_id": escrow_id, "work": work_output}
).json()

print(result["verdict"])   # "PASS" → payment released automatically

Protocol fee options

MethodAmountWhere to send
XRP on XRPL Mainnet $0.10 rmcSrkpZ2i2kuvtCPeTVetee9SixP4djR
USDC on Base (chain 8453) $0.10 USDC Address in 402 response accepts array

Call POST /evaluate with no fee context to receive a machine-readable 402 Payment Required listing both options. The agent picks whichever asset it holds.

Resources
API Docs & Playground OpenAPI Spec Smithery Listing Agent Marketplace Compliance XRPL Agentic Transactions