x402-v1 · algorand-mainnet · sub-3s finality

The Settlement Layer
for Autonomous AI Agents

x402 lets AI agents pay for API access atomically on Algorand. Three lines of code. Zero custody. Cross-chain USDC bridging to Ethereum, Solana, and Base.

AI Agent POST /api/agent-action HTTP 402 (pay+json) Ed25519 Proof Sandbox Export Validate → Auth → Sign Algorand Settlement Wormhole Bridge
<3s
Algorand finality
$0.10
per settlement
7
destination chains
16
max batch intents
0
partial executions

Three lines from zero to settlement

Install the SDK, configure your key, call executeTrade. The 402 handshake is absorbed automatically.

Install bash
npm install @m-reynaldo35/x402-client algosdk
Settle USDC → Ethereum in 3 lines typescript
import { AlgoAgentClient, DestinationChain } from "@m-reynaldo35/x402-client";

const client = new AlgoAgentClient({
  baseUrl: "https://ai-agentic-wallet.com",
  privateKey: yourAlgorandSecretKey,        // 64-byte Uint8Array
  onProgress: (e) => console.log(e.stage, e.message),  // optional
});

const result = await client.executeTrade({
  senderAddress: "YOUR_ALGO_ADDRESS",
  destinationChain: DestinationChain.ETHEREUM,
  destinationRecipient: "0xYOUR_ETH_ADDRESS",
});

console.log(result);
// { success: true, settlement: { txnId: "...", confirmedRound: 47291042 } }
Batch: settle to 3 chains atomically typescript
const batch = await client.executeBatch({
  senderAddress: "YOUR_ALGO_ADDRESS",
  intents: [
    { destinationChain: "ethereum", destinationRecipient: ETH_ADDR },
    { destinationChain: "solana",   destinationRecipient: SOL_ADDR },
    { destinationChain: "base",     destinationRecipient: BASE_ADDR },
  ],
});
// All 3 succeed or all 3 revert — zero partial execution risk

Built for autonomous agents

Every feature is designed for machine-to-machine settlement. No human in the loop.

x402 Handshake

HTTP 402 challenge-response. The SDK absorbs the bounce, builds the Ed25519 proof, and retries — all in one call.

Atomic Groups

Up to 16 cross-chain intents bundled in a single Algorand atomic group. All settle or none do.

🌉

Wormhole Bridge

Native USDC bridging to Ethereum, Solana, Base, Arbitrum, Optimism, Polygon, and Avalanche via Folks Finance NTT.

🔮

Gora Oracle

Every settlement is bounded by Gora consensus price ±slippage. Stale oracle data (>15s) is rejected at the AVM level.

🛡

Replay Protection

Every X-PAYMENT nonce is stored in Upstash Redis with 60s TTL. Duplicate signatures are rejected before they reach the chain.

🔒

Seedless Signing

No private keys in the transaction builder. Signing happens in Rocca Wallet after FIDO2 authentication via Liquid Auth.

Endpoints

All endpoints are served at https://ai-agentic-wallet.com

GET /health

Server health check. Returns network status, Algorand node provider, and latest round.

POST /api/agent-action X-PAYMENT required

Construct an unsigned atomic group for a single cross-chain trade. Returns a SandboxExport envelope. Pass X-SLIPPAGE-BIPS header to override default 50bps slippage.

POST /api/batch-action X-PAYMENT required

Construct a batched atomic group for up to 16 simultaneous cross-chain trades. Returns SandboxExport + batchSize.

POST /api/execute

Execute the full settlement pipeline on a SandboxExport: validate → Liquid Auth → Rocca sign → Algorand broadcast. Returns txnId and confirmedRound on success.

X-PAYMENT header structure json
// Base64-encoded JSON payload:
{
  "groupId":      "base64 SHA-512/256 atomic group hash",
  "transactions": ["base64 signed txn blob", "..."],
  "senderAddr":   "ALGO58CHARADDRESS...",
  "signature":    "base64 Ed25519 sig over groupId bytes",
  "timestamp":    1708339200,   // Unix epoch, <60s old
  "nonce":         "uuid-v4"         // Single-use
}

Cross-chain USDC destinations

USDC settles on Algorand first, then bridges via Wormhole NTT. Choose destination per-trade or mix in a batch.

Algorand origin
Ethereum
Solana
Base
Arbitrum
Optimism
Polygon
Avalanche

Zero-trust by design

Multiple independent layers of enforcement. Any single layer failing blocks the entire settlement.

🔐

Ed25519 Verification

Every request must prove ownership of the paying address via algosdk.verifyBytes(). No signature, no access.

🧱

TEAL LogicSig

AVM-level stateless smart signature enforces: fee ≤ 1000 µALGO, type = axfer, amount ≤ 50M µUSDC.

60s Time Window

X-PAYMENT timestamp is validated server-side. Offers expire after 5 minutes. Nonces are single-use.

🏃

Rate Limiting

Upstash Redis sliding window: 100 req/10s per platform key, 30 req/10s per IP. In-memory fallback when Redis is degraded.

Find this agent

Machine-readable manifests for agent registries and AI protocol marketplaces.

OpenClaw Registry

Structured JSON protocol manifest for OpenClaw-compatible agent marketplaces.


openclaw-registry.json →

Moltbook Agent

Full agent capability manifest: pricing, endpoints, auth scheme, and identity claims.


moltbook-agent.json →

Skill Manifest

LLM-readable markdown describing how an AI agent should interact with this protocol.


skill.md →