XRP Ledger Wallet API

XRP Ledger Wallet API for Autonomous AI Agents

Create XRP accounts, send XRP in 3–5 seconds, trade on the XRPL DEX, and access issued currencies — without running an XRPL node or validator. BIP-32 derivation path m/44'/144'/0'/0/0, $0.00001 transaction fees, 1500 TPS.

Get API Key All Wallet APIs
3–5s
Settlement Time
$0.00001
Transaction Fee
1,500
TPS Capacity
10 XRP
Account Reserve

The payment chain built for machine-to-machine speed

The XRP Ledger was designed from the ground up for fast, low-cost settlement — not mining, not gas auctions, not congestion-dependent fees. A fixed fee of 10 drops (0.00001 XRP, roughly $0.000006 at current prices) applies to every transaction regardless of network load. For agents making dozens or hundreds of payments per day, this fee predictability is a significant operational advantage.

3–5 Second Final Settlement

XRPL uses a federated Byzantine Agreement consensus mechanism. There is no mining, no mempool congestion, and no fee market. Transactions reach final consensus in 3–5 seconds on every block, every time — not just when the network is quiet.

💸

$0.00001 Flat Fees

The minimum transaction fee on XRPL is 10 drops (0.00001 XRP). Unlike Ethereum where gas prices fluctuate by 10–100x during congestion, XRPL's fee is deterministic and negligible. An agent making 1,000 transactions per day pays less than $0.01 total in fees.

🏦

Built-in On-Chain DEX

The XRP Ledger has a native decentralized exchange built into the protocol — no smart contract required. Agents can place limit orders, market orders, and access liquidity across any currency pair traded on XRPL, including XRP/USDC and XRP/USDT pairings.

🪙

Issued Currencies (IOUs)

Any entity on XRPL can issue tokens representing any asset — USDC, USDT, gold, fiat currencies. These "issued currencies" are settled peer-to-peer through trust lines. Your agent can hold and transfer USDC on XRPL just like native XRP.

🖼️

XLS-20 NFT Support

The XLS-20 amendment added native NFT support to XRPL. Agents can mint, transfer, and trade NFTs representing digital assets, certificates, or on-chain agreements without deploying smart contracts — all via the same account and key pair.

🌐

No Node Required

Purple Flea connects to XRPL's public validator network on your behalf. Your agent makes REST API calls — no xrpl.js dependency, no WebSocket connection management, no validator selection logic needed in your agent code.

XRP key derivation and account activation

XRP Ledger uses secp256k1 keys derived via BIP-32 and BIP-44 with coin type 144. New accounts require a one-time 10 XRP reserve deposit that is locked as long as the account exists. Purple Flea handles account activation automatically on wallet creation.

PropertyValue
BIP-44 Coin Type144
Derivation Pathm/44'/144'/0'/0/0
Address EncodingBase58Check (custom alphabet)
Address Length25–34 characters
Address Prefixr...
Key Curvesecp256k1 (or ed25519)
Account Reserve10 XRP (locked)
Owner Reserve+2 XRP per object owned
Min Transaction Fee10 drops (0.00001 XRP)
Reserve note: The 10 XRP base reserve is locked permanently in the account (unless deleted). Owner reserves (trust lines, offers, escrow objects) add 2 XRP each. Purple Flea funds the initial reserve as part of wallet creation — no XRP purchase required before first use.

XRPL address derivation

# XRPL uses its own base58 alphabet # (not Bitcoin's — different character set) XRPL_ALPHABET = b"rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz" # From secp256k1 public key to XRPL address: import hashlib def pub_key_to_xrpl_address(pub_key: bytes) -> str: # 1. SHA-256 of compressed public key sha256_hash = hashlib.sha256(pub_key).digest() # 2. RIPEMD-160 of SHA-256 ripemd = hashlib.new("ripemd160") ripemd.update(sha256_hash) account_id = ripemd.digest() # 3. Prepend 0x00 version byte payload = bytes([0x00]) + account_id # 4. Double SHA-256 checksum (4 bytes) ck = hashlib.sha256( hashlib.sha256(payload).digest() ).digest()[:4] # 5. Encode with XRPL base58 alphabet return base58_encode(payload + ck, XRPL_ALPHABET) # Result: "rXyz..." (starts with r) PYTHON

XRP Ledger wallet operations via Purple Flea API

All XRPL operations — wallet creation, XRP sends, DEX orders, and issued currency transfers — are available through Purple Flea's unified REST API. No XRPL SDK, no WebSocket connection, no validator configuration needed.

Generate an XRP wallet and activate it

import requests API_KEY = "pf_live_your_key" BASE = "https://purpleflea.com/api" HEADERS = { "Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json", } def create_xrp_wallet(agent_id: str) -> dict: """ Creates and activates an XRP Ledger account. Purple Flea funds the 10 XRP reserve. """ r = requests.post( f"{BASE}/wallet/create", headers=HEADERS, json={ "agentId": agent_id, "chain": "xrp", }, ) data = r.json() # Returns: address (r...), # mnemonic, privateKey, # derivationPath, activated (bool) return data wallet = create_xrp_wallet("my-agent") print("XRP Address:", wallet["address"]) print("Activated:", wallet["activated"]) # Address: rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh PYTHON

Check XRP and token balances

def get_xrp_balance(address: str) -> dict: r = requests.get( f"{BASE}/wallet/balance", headers=HEADERS, params={ "chain": "xrp", "address": address, }, ) data = r.json() # data["xrp"] — available XRP # data["reserved"] — locked in reserve # data["tokens"] — list of IOU balances return data bal = get_xrp_balance(wallet["address"]) print(f"Available: {bal['xrp']} XRP") print(f"Reserved: {bal['reserved']} XRP") for token in bal["tokens"]: print(f"{token['currency']}: {token['value']}") PYTHON

Send XRP — confirms in 3–5 seconds

def send_xrp( from_agent: str, to_address: str, amount_xrp: float, memo: str = "", ) -> dict: """ Sends XRP to any activated XRPL address. Finality guaranteed in 3-5 seconds. memo: optional UTF-8 string stored on-chain. """ r = requests.post( f"{BASE}/wallet/send", headers=HEADERS, json={ "agentId": from_agent, "chain": "xrp", "to": to_address, "amount": amount_xrp, "memo": memo, }, ) data = r.json() # data["txHash"] — transaction hash # data["fee"] — fee in XRP drops # data["ledger"] — ledger index return data tx = send_xrp( "my-agent", "rCounterparty...", 5.0, "payment for task #42", ) print(f"TX: {tx['txHash']}") print(f"Ledger: {tx['ledger']}") PYTHON

Place a DEX order on XRPL

def place_dex_order( agent_id: str, pays: dict, gets: dict, ) -> dict: """ Place a limit order on the XRPL built-in DEX. pays: {"currency":"XRP","value":"10"} or {"currency":"USD","issuer":"r...","value":"5"} gets: same format """ r = requests.post( f"{BASE}/xrpl/offer", headers=HEADERS, json={ "agentId": agent_id, "takerPays": pays, "takerGets": gets, }, ) return r.json() # Buy 5 USDC for 10 XRP on the XRPL DEX order = place_dex_order( "my-agent", pays={"currency": "XRP", "value": "10"}, gets={ "currency": "USD", "issuer": "rhub8VRN55s...", "value": "5" }, ) PYTHON

Advanced XRP Ledger capabilities for agents

🏛️

Native On-Chain DEX

The XRPL DEX is built into the protocol — not a deployed smart contract. Place limit orders for any currency pair traded on XRPL. Orders fill automatically when counterparty offers cross. No DEX fees beyond the base transaction fee.

🤝

Trust Lines for IOUs

To hold issued currencies (USDC, USDT, tokenized fiat), your agent establishes a trust line with the issuer. Purple Flea's API handles trust line creation automatically when you first transact with an issued currency.

🔒

On-Chain Escrow

XRPL has native escrow built into the protocol — time-locked or condition-locked XRP escrows without smart contracts. Agents can lock XRP with a crypto-condition, releasing only when a counterparty presents the preimage.

📋

Payment Channels

XRPL payment channels allow agents to stream micropayments off-ledger and settle on-chain. An agent can open a channel, send thousands of signed payment claims, and the recipient settles once — paying only one transaction fee.

🖼️

XLS-20 NFTs

Mint NFTs representing task completions, certifications, or on-chain agreements. The XLS-20 standard supports royalties (up to 50%), transfer restrictions, and burn permissions — all configurable at mint time.

🛤️

Path Finding

XRPL's path finding algorithm routes payments through intermediate currencies automatically. Your agent can pay in XRP while the recipient receives USDC — XRPL finds the best path through available offers on the DEX.

Understanding XRP reserves for agent wallets

XRPL requires XRP to be locked as reserves for account existence and for each on-ledger object. This prevents spam accounts and limits ledger bloat. Purple Flea handles the initial reserve funding — but your agent should understand the reserve model to manage its XRP balance correctly.

Base Reserve: 10 XRP

Every account on XRPL must maintain at least 10 XRP locked as base reserve. This amount is permanently locked as long as the account exists. Purple Flea funds this reserve on wallet creation. The reserve is released only if the account is deleted (requires balance near 10 XRP and no open objects).

Owner Reserve: 2 XRP per object

Each on-ledger object your agent owns (trust line, DEX offer, escrow, NFT) adds 2 XRP to the required reserve. If your agent opens 5 trust lines and 3 DEX offers, it needs 10 + (8 × 2) = 26 XRP locked. Closing objects returns the owner reserve.

Check reserve requirements

def get_account_info(address: str) -> dict: """ Returns full account state including reserve requirements and owned objects. """ r = requests.get( f"{BASE}/xrpl/account", headers=HEADERS, params={"address": address}, ) data = r.json() # data["balance"] — total XRP # data["baseReserve"] — 10 XRP # data["ownerReserve"] — objects × 2 XRP # data["available"] — spendable XRP # data["ownerCount"] — # of objects # data["trustLines"] — token balances # data["offers"] — open DEX orders return data info = get_account_info(wallet["address"]) spendable = info["available"] print(f"Spendable XRP: {spendable}") print(f"Owner objects: {info['ownerCount']}") PYTHON

What AI agents build on the XRP Ledger

🔄

High-Frequency Micro-Payments

Agents billing per API call, per second of compute, or per data record need a payment rail that handles high volumes without gas fees. At $0.000006 per transaction, an agent making 10,000 payments per day spends $0.06 in total fees.

📈

DEX Arbitrage

The XRPL DEX provides on-chain order books for currency pairs. Agents can monitor the DEX, identify price discrepancies against off-chain markets, and place limit orders to capture arbitrage — all via the Purple Flea API.

🌉

Cross-Currency Settlement

XRPL path finding lets agents send one currency and have the recipient receive another. An agent earning XRP from casino winnings can automatically convert to USDC via the DEX path in the same transaction as the settlement.

Add an XRP wallet to your agent today

One API call creates and activates an XRPL account. No node, no reserve funding, no trust line setup. Your agent is transacting on the XRP Ledger in 60 seconds.

More wallet APIs