{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/pt-BR/products/stablecoin/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["partial","admonition"]},"type":"markdown"},"seo":{"title":"RLUSD on the XRP Ledger","description":"User guides, API reference, and support resources.","siteUrl":"https://docs.ripple.com","lang":"en-US"},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"rlusd-on-the-xrp-ledger","__idx":0},"children":["RLUSD on the XRP Ledger"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Ripple USD"," uses the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Issued Tokens"]}," functionality that is native to the XRP Ledger."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["On the XRP Ledger, a stablecoin is created by an issuer holding real-world assets as collateral, and creating equivalent tokens on the ledger. Users establish a trust line with the issuer to receive, hold, and transfer issued stablecoin. Transactions are fast and secure, benefiting from the efficiency of the XRP Ledger."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To learn more about the XRP Ledger issuer settings, see the ","Ripple USD"," ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://github.com/ripple/RLUSD-Implementation/blob/main/doc/rlusd-xrpl-settings.md","target":"_blank"},"children":["GitHub repository"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"networks","__idx":1},"children":["Networks"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ","Ripple USD"," stablecoin is available on the XRP Ledger Mainnet and Testnet networks."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"mainnet","__idx":2},"children":["Mainnet"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Mainnet"]},", short for main network, is the primary and fully functional blockchain network where ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["real"]}," transactions are processed and actual value is transferred. The Mainnet is the live environment that operates the main ledger, as opposed to Testnets which are used for development and testing purposes. ","Ripple USD"," tokens on a Mainnet are backed by real-word assets."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning","name":"Mainnet tokens"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Mainnet ","Ripple USD"," tokens hold ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["real"]}," financial value, therefore you should not use Mainnet for testing purposes."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Below you can find the Mainnet details for the Ripple USD token:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Network name"]},": XRP Ledger Mainnet"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["JSON-RPC URL"]},": ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://xrplcluster.com/","target":"_blank"},"children":["https://xrplcluster.com/"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Websocket"]},": wss://xrplcluster.com"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Issuer account address"]},": ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://livenet.xrpl.org/accounts/rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De/transactions","target":"_blank"},"children":["rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"testnet","__idx":3},"children":["Testnet"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Testnet"]},", short for test network, operates similarly to a Mainnet but without the associated real-world value and financial risk. Testnets allow developers to test out features in a safe environment. For example, a developer can simulate transferring Ripple USD between wallets on the XRP Ledger without risking real money in case of errors."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning","name":"Testnet tokens"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Ripple USD"," tokens on a Testnet hold no financial value, are intended for ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["testing"]}," purposes only, and are not backed by real-world assets."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Here are the Testnet details for the ","Ripple USD"," token:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Network name"]},": XRP Ledger Testnet"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["JSON-RPC URL"]},": https://s.altnet.rippletest.net:51234/"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Websocket"]},": wss://s.altnet.rippletest.net:51233/"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Issuer account address"]},": ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://testnet.xrpl.org/accounts/rQhWct2fv4Vc4KRjRgMrxa8xPN9Zx9iLKV","target":"_blank"},"children":["rQhWct2fv4Vc4KRjRgMrxa8xPN9Zx9iLKV"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"set-up-rlusd-trust-line-on-the-xrpl","__idx":4},"children":["Set up RLUSD trust line on the XRPL"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Before an account can hold or receive RLUSD on the XRP Ledger, it must establish a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["trust line"]}," with the RLUSD issuer. A trust line is a relationship between two accounts that allows one account to hold tokens issued by the other. Without a trust line to the RLUSD issuer, your account cannot receive RLUSD payments."]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Account reserve requirement:"]}," To set up a trust line, your account must first be ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["active"]}," on the XRP Ledger. This requires a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["base reserve of 1 XRP"]},". Each trust line also increases the account's ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["owner reserve by 0.2 XRP"]},". This means you need at least ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["1.2 XRP"]}," in your account to create a single RLUSD trust line. These reserves are held in your account and cannot be spent while the trust line exists. For more details, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://xrpl.org/docs/concepts/accounts/reserves"},"children":["Reserves"]},"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This section shows you how to set up a trust line for RLUSD on the XRPL Testnet using either ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["TypeScript"]}," or ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Python"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"prerequisites","__idx":5},"children":["Prerequisites"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Choose your preferred language:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["TypeScript"]},": ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://nodejs.org/"},"children":["Node.js 16 or later"]}," and a terminal or code editor."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Python"]},": ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://www.python.org/"},"children":["Python 3.8 or later"]}," and a terminal or code editor."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"rlusd-currency-details","__idx":6},"children":["RLUSD currency details"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["On the XRP Ledger, non-standard currency codes (longer than 3 characters) must be represented as a 40-character hex string. The hex representation for RLUSD is:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"524C555344000000000000000000000000000000\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"option-1-typescript","__idx":7},"children":["Option 1: TypeScript"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"1-set-up-your-project","__idx":8},"children":["1. Set up your project"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create and initialize your project:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"shell","header":{"controls":{"copy":{}}},"source":"mkdir xrpl-rlusd-trustline\ncd xrpl-rlusd-trustline\nnpm init -y\n","lang":"shell"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Install the required dependencies:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"shell","header":{"controls":{"copy":{}}},"source":"npm install xrpl typescript ts-node\n","lang":"shell"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"2-configure-typescript","__idx":9},"children":["2. Configure TypeScript"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tsconfig.json"]}," file:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"compilerOptions\": {\n    \"target\": \"ES2020\",\n    \"module\": \"CommonJS\",\n    \"lib\": [\"ES2020\"],\n    \"strict\": true,\n    \"esModuleInterop\": true,\n    \"skipLibCheck\": true,\n    \"forceConsistentCasingInFileNames\": true,\n    \"outDir\": \"./dist\",\n    \"rootDir\": \"./\"\n  },\n  \"include\": [\"*.ts\"],\n  \"exclude\": [\"node_modules\"]\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Update the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["scripts"]}," section in your ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["package.json"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"\"scripts\": {\n  \"start\": \"ts-node main.ts\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"3-write-the-trust-line-setup-code","__idx":10},"children":["3. Write the trust line setup code"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["main.ts"]}," file with the following code:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"import {\n  Client,\n  IssuedCurrencyAmount,\n  TransactionMetadata,\n  TrustSetFlags,\n  Wallet,\n} from \"xrpl\";\n\n// RLUSD token details (Testnet)\nconst RLUSD: IssuedCurrencyAmount = {\n  currency: \"524C555344000000000000000000000000000000\",\n  issuer: \"rQhWct2fv4Vc4KRjRgMrxa8xPN9Zx9iLKV\",\n  value: \"1000000000\",\n};\n\nasync function main() {\n  const client = new Client(\"wss://s.altnet.rippletest.net:51233\");\n  await client.connect();\n\n  try {\n    // Step 1: Create and fund a wallet on Testnet\n    console.log(\"Creating and funding a wallet on Testnet...\");\n    const userWallet = Wallet.generate();\n    await client.fundWallet(userWallet);\n\n    console.log(\"======= Wallet Details =======\");\n    console.log(\"Address:\", userWallet.address);\n    console.log(\"Seed:\", userWallet.seed);\n    console.log(\"NOTE: Store the seed securely. Do not share it.\");\n    console.log(\"==============================\\n\");\n\n    // Step 2: Create a trust line for RLUSD\n    console.log(\"Creating a trust line for RLUSD...\");\n    const response = await client.submitAndWait(\n      {\n        TransactionType: \"TrustSet\",\n        Account: userWallet.address,\n        LimitAmount: RLUSD,\n        Flags: TrustSetFlags.tfSetNoRipple,\n      },\n      { autofill: true, wallet: userWallet }\n    );\n\n    if (\n      response.result.validated &&\n      (response.result.meta as TransactionMetadata).TransactionResult !==\n        \"tesSUCCESS\"\n    ) {\n      throw new Error(`Transaction failed: ${JSON.stringify(response)}`);\n    }\n\n    console.log(\n      `Trustline created successfully: https://testnet.xrpl.org/transactions/${response.result.hash}`\n    );\n    console.log(\"\\nYour wallet is now ready to receive RLUSD on Testnet!\");\n  } finally {\n    await client.disconnect();\n  }\n}\n\nmain().catch(console.error);\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"4-run-the-script","__idx":11},"children":["4. Run the script"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"shell","header":{"controls":{"copy":{}}},"source":"npm start\n","lang":"shell"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["After running the script, your terminal displays the wallet address, seed, and a transaction link confirming the trust line was created. Your wallet is now ready to receive RLUSD on the XRPL Testnet."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"option-2-python","__idx":12},"children":["Option 2: Python"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"1-set-up-your-project-1","__idx":13},"children":["1. Set up your project"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create a project directory and install the XRPL Python library:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"shell","header":{"controls":{"copy":{}}},"source":"mkdir xrpl-rlusd-trustline\ncd xrpl-rlusd-trustline\npip install xrpl-py\n","lang":"shell"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"2-write-the-trust-line-setup-code","__idx":14},"children":["2. Write the trust line setup code"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["setup_rlusd_trustline.py"]}," file with the following code:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"from xrpl.clients import JsonRpcClient\nfrom xrpl.models.transactions import TrustSet\nfrom xrpl.models.amounts import IssuedCurrencyAmount\nfrom xrpl.transaction import submit_and_wait\nfrom xrpl.wallet import generate_faucet_wallet\n\n# RLUSD token details (Testnet)\nRLUSD_CURRENCY_HEX = \"524C555344000000000000000000000000000000\"\nRLUSD_ISSUER = \"rQhWct2fv4Vc4KRjRgMrxa8xPN9Zx9iLKV\"\n\ndef setup_rlusd_trustline():\n    \"\"\"Creates a wallet and sets up a trust line for RLUSD on XRPL Testnet.\"\"\"\n\n    # Connect to XRPL Testnet\n    client = JsonRpcClient(\"https://s.altnet.rippletest.net:51234\")\n\n    # Step 1: Create and fund a wallet on Testnet\n    print(\"Creating and funding a wallet on Testnet...\")\n    wallet = generate_faucet_wallet(client)\n\n    print(\"======= Wallet Details =======\")\n    print(f\"Address: {wallet.classic_address}\")\n    print(f\"Seed: {wallet.seed}\")\n    print(\"NOTE: Store the seed securely. Do not share it.\")\n    print(\"==============================\\n\")\n\n    # Step 2: Create a trust line for RLUSD\n    print(\"Creating a trust line for RLUSD...\")\n    trust_set_tx = TrustSet(\n        account=wallet.classic_address,\n        limit_amount=IssuedCurrencyAmount(\n            currency=RLUSD_CURRENCY_HEX,\n            issuer=RLUSD_ISSUER,\n            value=\"1000000000\",\n        ),\n        flags=131072,  # tfSetNoRipple\n    )\n\n    try:\n        response = submit_and_wait(trust_set_tx, client, wallet)\n\n        if response.is_successful():\n            print(\"Trustline created successfully!\")\n            print(f\"Transaction hash: {response.result['hash']}\")\n            print(\n                f\"View on explorer: https://testnet.xrpl.org/transactions/{response.result['hash']}\"\n            )\n            print(\"\\nYour wallet is now ready to receive RLUSD on Testnet!\")\n        else:\n            print(\"Trustline creation failed.\")\n            print(f\"Error: {response.result.get('engine_result_message')}\")\n\n    except Exception as e:\n        print(f\"Error creating trust line: {str(e)}\")\n\nif __name__ == \"__main__\":\n    setup_rlusd_trustline()\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"3-run-the-script","__idx":15},"children":["3. Run the script"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"shell","header":{"controls":{"copy":{}}},"source":"python setup_rlusd_trustline.py\n","lang":"shell"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["After running the script, your terminal displays the wallet address, seed, and a transaction link confirming the trust line was created. Your wallet is now ready to receive RLUSD on the XRPL Testnet."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"get-testnet-rlusd","__idx":16},"children":["Get Testnet RLUSD"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Once your trust line is set up, you can obtain Testnet RLUSD tokens by visiting the RLUSD faucet at ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://tryrlusd.com/"},"children":["https://tryrlusd.com/"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"send-an-rlusd-payment","__idx":17},"children":["Send an RLUSD payment"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Once your trust line is established, you can send RLUSD to another account that also has an RLUSD trust line."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["First, create a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".env"]}," file at the root of your project:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"WALLET_SEED=sYourSeedHere\nDESTINATION_ADDRESS=rDestinationAddressHere\nRLUSD_AMOUNT=10\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"typescript","__idx":18},"children":["TypeScript"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"import \"dotenv/config\";\nimport { Client, Payment, Wallet, TransactionMetadata } from \"xrpl\";\n\nconst RLUSD_CURRENCY = \"524C555344000000000000000000000000000000\";\nconst RLUSD_ISSUER = \"rQhWct2fv4Vc4KRjRgMrxa8xPN9Zx9iLKV\"; // Testnet issuer\n\nasync function sendRlusd(\n  seed: string,\n  destination: string,\n  amount: string\n) {\n  const client = new Client(\"wss://s.altnet.rippletest.net:51233\");\n  await client.connect();\n\n  try {\n    const wallet = Wallet.fromSeed(seed);\n\n    console.log(`\\nSending ${amount} RLUSD from ${wallet.address} to ${destination}...`);\n\n    const response = await client.submitAndWait(\n      {\n        TransactionType: \"Payment\",\n        Account: wallet.address,\n        Destination: destination,\n        Amount: {\n          currency: RLUSD_CURRENCY,\n          issuer: RLUSD_ISSUER,\n          value: amount,\n        },\n      },\n      { autofill: true, wallet }\n    );\n\n    if (\n      response.result.validated &&\n      (response.result.meta as TransactionMetadata).TransactionResult ===\n        \"tesSUCCESS\"\n    ) {\n      console.log(\"Payment successful!\");\n      console.log(`Transaction hash: ${response.result.hash}`);\n    } else {\n      console.log(\"Payment failed.\");\n      console.log(`Result: ${JSON.stringify(response.result)}`);\n    }\n  } finally {\n    await client.disconnect();\n  }\n}\n\n// Load values from .env file\nconst seed = process.env.WALLET_SEED!;\nconst destination = process.env.DESTINATION_ADDRESS!; // Must have an RLUSD trust line\nconst amount = process.env.RLUSD_AMOUNT || \"10\";\n\nsendRlusd(seed, destination, amount).catch(console.error);\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"python","__idx":19},"children":["Python"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"from xrpl.clients import JsonRpcClient\nfrom xrpl.models.transactions import Payment\nfrom xrpl.transaction import submit_and_wait\nfrom xrpl.wallet import Wallet\n\ndef send_rlusd(seed, destination_address, amount, issuer_address):\n    \"\"\"\n    Sends RLUSD from a wallet to a destination address.\n\n    Parameters:\n        seed: The seed of the sending wallet.\n        destination_address: The address to send RLUSD to.\n        amount: Amount of RLUSD to send.\n        issuer_address: The address of the RLUSD issuer.\n    \"\"\"\n    client = JsonRpcClient(\"https://s.altnet.rippletest.net:51234\")\n    wallet = Wallet.from_seed(seed)\n\n    currency_hex = \"524C555344000000000000000000000000000000\"\n\n    payment = Payment(\n        account=wallet.classic_address,\n        amount={\n            \"currency\": currency_hex,\n            \"value\": str(amount),\n            \"issuer\": issuer_address,\n        },\n        destination=destination_address,\n    )\n\n    print(f\"\\nSending {amount} RLUSD from {wallet.classic_address} to {destination_address}...\")\n\n    try:\n        response = submit_and_wait(payment, client, wallet)\n\n        if response.is_successful():\n            print(\"Payment successful!\")\n            print(f\"Transaction hash: {response.result['hash']}\")\n        else:\n            print(\"Payment failed.\")\n            print(f\"Error: {response.result.get('engine_result_message')}\")\n\n    except Exception as e:\n        print(f\"Error sending payment: {str(e)}\")\n\nif __name__ == \"__main__\":\n    import os\n    from dotenv import load_dotenv\n\n    load_dotenv()\n\n    seed = os.environ[\"WALLET_SEED\"]\n    destination = os.environ[\"DESTINATION_ADDRESS\"]  # Must have an RLUSD trust line\n    amount = int(os.getenv(\"RLUSD_AMOUNT\", \"10\"))\n    issuer = \"rQhWct2fv4Vc4KRjRgMrxa8xPN9Zx9iLKV\"  # RLUSD Testnet issuer\n\n    send_rlusd(seed, destination, amount, issuer)\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Important:"]}," The destination account ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["must"]}," have an RLUSD trust line set up before it can receive RLUSD payments. Transactions to accounts without a trust line will fail."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"further-reading","__idx":20},"children":["Further reading"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["RLUSD implementation:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://github.com/ripple/RLUSD-Implementation","target":"_blank"},"children":["RLUSD GitHub repository"]}]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["XRPL documentation:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Concepts"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://xrpl.org/docs/concepts/tokens/fungible-tokens","target":"_blank"},"children":["Fungible Tokens"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://xrpl.org/docs/concepts/tokens/fungible-tokens/stablecoins/#stablecoins","target":"_blank"},"children":["Stablecoins"]}]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Tutorials"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://xrpl.org/docs/tutorials/javascript/send-payments/create-accounts-send-xrp","target":"_blank"},"children":["Create Accounts and Send XRP Using JavaScript"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://xrpl.org/docs/tutorials/javascript/send-payments/create-trust-line-send-currency","target":"_blank"},"children":["Create Trust Line and Send Currency Using JavaScript"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://xrpl.org/docs/tutorials/how-tos/use-tokens/trade-in-the-decentralized-exchange","target":"_blank"},"children":["Trade in the Decentralized Exchange"]}]}]}]}]}]}]}]},"headings":[{"value":"RLUSD on the XRP Ledger","id":"rlusd-on-the-xrp-ledger","depth":1},{"value":"Networks","id":"networks","depth":2},{"value":"Mainnet","id":"mainnet","depth":3},{"value":"Testnet","id":"testnet","depth":3},{"value":"Set up RLUSD trust line on the XRPL","id":"set-up-rlusd-trust-line-on-the-xrpl","depth":2},{"value":"Prerequisites","id":"prerequisites","depth":3},{"value":"RLUSD currency details","id":"rlusd-currency-details","depth":3},{"value":"Option 1: TypeScript","id":"option-1-typescript","depth":3},{"value":"1. Set up your project","id":"1-set-up-your-project","depth":4},{"value":"2. Configure TypeScript","id":"2-configure-typescript","depth":4},{"value":"3. Write the trust line setup code","id":"3-write-the-trust-line-setup-code","depth":4},{"value":"4. Run the script","id":"4-run-the-script","depth":4},{"value":"Option 2: Python","id":"option-2-python","depth":3},{"value":"1. Set up your project","id":"1-set-up-your-project-1","depth":4},{"value":"2. Write the trust line setup code","id":"2-write-the-trust-line-setup-code","depth":4},{"value":"3. Run the script","id":"3-run-the-script","depth":4},{"value":"Get Testnet RLUSD","id":"get-testnet-rlusd","depth":3},{"value":"Send an RLUSD payment","id":"send-an-rlusd-payment","depth":2},{"value":"TypeScript","id":"typescript","depth":3},{"value":"Python","id":"python","depth":3},{"value":"Further reading","id":"further-reading","depth":2}],"frontmatter":{"seo":{"title":"RLUSD on the XRP Ledger"}},"lastModified":"2026-10-23T14:40:26.563Z","isTranslationFallback":true,"pagePropGetterError":{"message":"","name":""}},"slug":"/pt-br/products/stablecoin/developer-resources/rlusd-on-the-xrpl","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}