How to Send XRP: A Complete Guide

·

This tutorial provides a step-by-step guide on sending XRP payments across different programming languages using official XRP Ledger client libraries. Whether you're testing on the XRP Ledger Testnet or preparing for production, you'll learn the essential procedures and best practices.


Prerequisites

Before sending XRP, ensure you have:


Step-by-Step: Sending XRP on the Testnet

1. Obtain Testnet Credentials

Generate a funded Testnet account using the XRP Ledger Testnet Faucet. Example credentials:

const wallet = xrpl.Wallet.fromSeed("sn3nxiW7v8KXzPzAqzyHXbSSKNuN9");
console.log("Address:", wallet.address); // Example: rMCcNuTcajgw7YTgBy1sys3b89QqjUrMpH

⚠️ Caution: Never use Testnet credentials for Mainnet.

2. Connect to a Testnet Server

Establish a connection to a public Testnet server:

const client = new xrpl.Client("wss://s.altnet.rippletest.net:51233");
await client.connect();

👉 Need help connecting? Check our advanced connection guide

3. Prepare the Transaction

Construct a Payment transaction with these minimum fields:

{
  "TransactionType": "Payment",
  "Account": "rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe",
  "DeliverMax": "2000000", // Amount in drops (1 XRP = 1,000,000 drops)
  "Destination": "rUCzEr6jrEyMpjhs4wSdQdz4g8Y382NxfM"
}

Key fields:

4. Sign the Transaction

Use your wallet to sign the transaction:

const signed = wallet.sign(preparedTx);
console.log("Transaction hash:", signed.hash);

5. Submit to the Network

Submit the signed transaction and wait for validation:

const result = await client.submitAndWait(signed.tx_blob);
console.log("Result:", result.meta.TransactionResult);

Production Considerations

Key Differences from Testnet

  1. Real XRP Acquisition: Purchase XRP from exchanges (e.g., OKX) or peer-to-peer platforms.
  2. Network Connection: Use Mainnet servers like wss://xrplcluster.com or run your own rippled node.

Security Best Practices


FAQs

Q1: How long does an XRP transaction take?

A: Typically 4-7 seconds to finalize in a validated ledger.

Q2: What’s the minimum XRP I can send?

A: The minimum is 1 drop (0.000001 XRP), but account reserves may apply.

Q3: Can I cancel a submitted transaction?

A: Only if it hasn’t been included in a ledger—use the LastLedgerSequence field to set expiration.

Q4: Why does my transaction fail with tecUNFUNDED_PAYMENT?

A: Your account lacks sufficient XRP after accounting for reserves (currently ~1 XRP).

Q5: Is Testnet XRP interchangeable with real XRP?

A: No—Testnet XRP has no monetary value.


Next Steps

👉 For more XRP tools, visit OKX’s developer portal