Install
openclaw skills install nexus-ap2-batched-settleAtomically settle up to 20 AI agent payments in a single XRPL Batch transaction. Implements Google's AP2 (Agent Payments Protocol) with XLS-56 Batch on XRP Ledger — ~5 second finality, ultra-low fees, non-custodial.
openclaw skills install nexus-ap2-batched-settleGoogle's Agent Payments Protocol (AP2) + XRP Ledger XLS-56 Batch | ~5s finality | Up to 20 mandates per tx | Non-custodial
Use this skill when an autonomous agent needs to:
Without batching: agent makes 20 API calls → 20 separate XRPL transactions → 20 separate signatures, 20× the latency, 20× the fees.
With NEXUS AP2 + XLS-56 Batch: agent calls 20 APIs → pre-authorizes via AP2 mandates → executes ONE signed Batch tx that atomically settles all 20. ALLORNOTHING mode guarantees no partial settlement.
For an Intent Mandate (agent autonomy, e.g. "spend up to 10 XRP this week"):
curl -X POST https://ai-service-hub-15.emergent.host/api/ap2/mandates/create \
-H "Content-Type: application/json" \
-d '{
"mandate_type": "intent",
"user_did": "did:agent:my-agent-id",
"agent_id": "my-agent-id",
"merchant_id": "nexus",
"mandate_content": {
"natural_language_intent": "Buy AI services up to 10 XRP this week",
"max_price": 10.0,
"currency": "XRP",
"time_window_start": "2026-02-26T00:00:00Z",
"time_window_end": "2026-03-05T23:59:59Z"
},
"user_signature": {
"algorithm": "ECDSA",
"signature_value": "sandbox_test_sig_001",
"timestamp": "2026-02-26T12:00:00Z",
"user_did": "did:agent:my-agent-id"
}
}'
Returns { "mandate_id": "ap2_intent_xxx", "expires_at": "...", ... }.
For a Cart Mandate (specific items, single purchase):
curl -X POST https://ai-service-hub-15.emergent.host/api/ap2/mandates/create \
-H "Content-Type: application/json" \
-d '{
"mandate_type": "cart",
"user_did": "did:agent:my-agent-id",
"agent_id": "my-agent-id",
"mandate_content": {
"total_amount": 1.0,
"currency": "XRP",
"items": [{"sku": "llm-gateway", "name": "LLM Gateway Call", "price": 1.0, "quantity": 1}]
},
"user_signature": {"algorithm":"ECDSA","signature_value":"sandbox_test_sig_002","timestamp":"2026-02-26T12:00:00Z","user_did":"did:agent:my-agent-id"}
}'
curl -X POST https://ai-service-hub-15.emergent.host/api/ap2/payments/settle \
-H "Content-Type: application/json" \
-d '{
"mandate_id": "ap2_intent_xxx",
"mandate_type": "intent",
"verification_record_id": "",
"amount": 2.5,
"currency": "XRP",
"payer_address": "r<your-xrpl-address>",
"recipient_address": "rM86ChiqozvfHwLckKRq2yTtzKLwfBe2XA",
"chain": "xrpl"
}'
Returns unsigned_tx — an XRPL Payment JSON with hex-encoded ap2.mandate.id memo. Sign with your wallet (Xumm, Crossmark, hardware), broadcast, then confirm:
curl -X POST "https://ai-service-hub-15.emergent.host/api/ap2/payments/<mandate_id>/confirm?tx_hash=<HASH>"
curl -X POST https://ai-service-hub-15.emergent.host/api/ap2/payments/batch \
-H "Content-Type: application/json" \
-d '{
"mandate_ids": ["ap2_cart_001", "ap2_cart_002", "ap2_cart_003", "ap2_intent_001"],
"payer_address": "r<your-xrpl-address>",
"chain": "xrpl",
"mode": "ALLORNOTHING"
}'
Returns an unsigned XLS-56 Batch transaction containing all inner Payments. Sign + broadcast once. After broadcast:
curl -X POST "https://ai-service-hub-15.emergent.host/api/ap2/payments/batch/<batch_id>/confirm?tx_hash=<HASH>"
curl -X POST https://ai-service-hub-15.emergent.host/api/xrpl/verify \
-H "Content-Type: application/json" \
-d '{"tx_hash":"<HASH>","currency":"XRP","expected_memo":"<mandate_id>"}'
Returns { valid: true, amount_drops, amount_xrp, currency, source, destination, memos: [...] }.
Want to settle in regulated USD stablecoin instead of XRP? RLUSD is supported natively.
One-time setup — establish a trust line to Ripple's RLUSD issuer:
curl -X POST https://ai-service-hub-15.emergent.host/api/xrpl/build/trust-line \
-H "Content-Type: application/json" \
-d '{"holder_address":"r<your-address>","currency":"RLUSD"}'
Then use "currency": "RLUSD" in your mandates. RLUSD issuer is rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De.
| URL | Method | Purpose |
|---|---|---|
/api/ap2/mandates/create | POST | Mint a new mandate |
/api/ap2/mandates | GET | List mandates (filter by agent_id) |
/api/ap2/payments/settle | POST | Settle one mandate |
/api/ap2/payments/batch | POST | Atomic batched settlement |
/api/ap2/payments/{id}/confirm | POST | Confirm broadcast tx |
/api/ap2/config | GET | AP2 discovery (chains, tokens, batch spec) |
/api/xrpl/config | GET | XRPL config (network, receiving address, assets) |
/api/xrpl/verify | POST | Verify any XRPL Payment tx |
/api/xrpl/build/escrow | POST | EscrowCreate template (FundsLocked → ResultSubmitted) |
ai-service-hub-15.emergent.host.sandbox_ prefix).This skill does NOT invoke any LLM. It is pure payment orchestration infrastructure — mandates, signatures, transaction templates, and on-chain verification.
NEXUS only constructs unsigned transaction JSON and verifies on-chain payment proofs. Buyers retain full control of their wallets and funds. Mandate creation is reversible (mandates can be deleted before settlement). For production use, replace sandbox_ signatures with real ECDSA/EdDSA signatures.
ap2, xrpl, agent-payments-protocol, batched-settlement, xls-56, non-custodial, rlusd, xrp, m2m-payments, low-latency