{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition","tabs","tab","code-snippet","partial"]},"redocly_category":"Documentation","type":"markdown"},"seo":{"title":"Migrate a Payments or FX Stack to the XRP Ledger","siteUrl":"https://xrpl.org","llmstxt":{"hide":false,"title":"XRPL Developer Portal & Documentation","description":"Explore XRP Ledger documentation, blogs, and other blockchain developer resources needed to start building and integrating with the ledger.","details":{"content":"XRP Ledger concepts, use cases, tutorials, references, and other blockchain developer resources. Also, stay up to date with release announcements and more through the XRPL Blog."},"sections":[{"title":"Introduction","description":"A high-level introduction to the XRP Ledger.","includeFiles":["docs/introduction/**/*.*","about/faq.md"],"excludeFiles":["docs/introduction/index.md"]},{"title":"Use Cases","description":"Real-world applications and business scenarios for the XRP Ledger.","includeFiles":["docs/use-cases/**/*.*"],"excludeFiles":["docs/use-cases/index.md","docs/use-cases/defi/index.md"]},{"title":"Agentic Transactions","description":"XRPL AI Starter Kit to help autonomous agents discover, set up, and execute agentic transactions on the XRP Ledger.","includeFiles":["docs/agents/**/*.*"]},{"title":"Concepts","description":"Core concepts including accounts, tokens, transactions, consensus, and more.","includeFiles":["docs/concepts/**/*.*"],"excludeFiles":["docs/concepts/index.md","docs/concepts/decentralized-storage/index.md","docs/concepts/payment-types/index.md"]},{"title":"Tutorials","description":"Step-by-step guides for building on the XRP Ledger in JavaScript, Python, Go, and more.","includeFiles":["docs/tutorials/**/*.*"]},{"title":"References","description":"Protocol specification, transaction types, ledger entries, and API methods.","includeFiles":["docs/references/**/*.*"],"excludeFiles":["docs/references/xrp-api.md","docs/references/data-api.md","docs/references/protocol/index.md","docs/references/protocol/ledger-data/ledger-entry-types/index.md","docs/references/protocol/transactions/index.md","docs/references/protocol/transactions/types/index.md","docs/references/http-websocket-apis/api-conventions/index.md","docs/references/http-websocket-apis/public-api-methods/*/index.md","docs/references/http-websocket-apis/admin-api-methods/*/index.md"]},{"title":"Infrastructure","description":"Install, configure, and troubleshoot xrpld and Clio servers.","includeFiles":["docs/infrastructure/**/*.*"],"excludeFiles":["docs/infrastructure/index.md","docs/infrastructure/*/index.md","docs/infrastructure/installation/build-run-xrpld-in-reporting-mode.md","docs/infrastructure/configuration/data-retention/index.md","docs/infrastructure/configuration/server-modes/index.md"]},{"title":"Blog (2023+)","description":"Recent XRPL Blog posts (showing 2023 and newer).","includeFiles":["blog/2023/**/*.*","blog/2024/**/*.*","blog/2025/**/*.*","blog/2026/**/*.*"]},{"title":"Resources","description":"Developer resources and contribution guidelines.","includeFiles":["resources/**/*.*"]}]},"description":"Learn how to migrate your payments or FX stack to the XRP Ledger."},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"migrate-a-payments-or-fx-stack-to-the-xrp-ledger","__idx":0},"children":["Migrate a Payments or FX Stack to the XRP Ledger"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you're already running a ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/use-cases/payments"},"children":["payments or FX stack"]}," on another chain and want to move it to the XRP Ledger, this guide is for you. The XRP Ledger simplifies your migration by reducing the number of components you have to build, secure, and maintain yourself. Many of the capabilities you'd implement as smart contracts on other chains are built into the protocol, so there's less to write, deploy, or audit."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This guide assumes familiarity with your current payment flows and a basic understanding of core XRP Ledger concepts, such as ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/tokens/fungible-tokens"},"children":["fungible tokens"]}," and ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/payment-types"},"children":["payment types"]},". The six steps below walk you through the path from mapping your stack to a live pilot."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"1-map-your-stack-to-xrp-ledger-primitives","__idx":1},"children":["1. Map Your Stack to XRP Ledger Primitives"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Many features that you'd implement as a smart contract on other chains are supported as native transaction types on the XRP Ledger. Before you port anything, examine which capabilities your stack uses and compare them to the built-in primitives:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"What You Need"},"children":["What You Need"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"XRP Ledger Native Capability"},"children":["XRP Ledger Native Capability"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Conditional or time-locked release of funds"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/payment-types/escrow"},"children":["Escrow"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Shared/multi-party control of an account"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/accounts/multi-signing"},"children":["Multi-signing"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Currency or asset issuance and management"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/tokens/fungible-tokens/trust-line-tokens"},"children":["Trust Line Tokens"]}," / ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/tokens/fungible-tokens/multi-purpose-tokens"},"children":["Multi-Purpose Tokens (MPTs)"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["On-chain currency conversion"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/tokens/decentralized-exchange"},"children":["DEX"]}," order book, ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/tokens/decentralized-exchange/automated-market-makers"},"children":["AMM"]},", and ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/tokens/fungible-tokens/paths"},"children":["pathfinding"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Rate quoting and price discovery"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/tokens/fungible-tokens/paths"},"children":["Pathfinding"]}," (",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/references/http-websocket-apis/public-api-methods/path-and-order-book-methods/ripple_path_find"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ripple_path_find"]}]},") and order book queries (",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/references/http-websocket-apis/public-api-methods/path-and-order-book-methods/book_offers"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["book_offers"]}]},")"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Market making and liquidity provision"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/tokens/decentralized-exchange/offers"},"children":["DEX offers"]}," and ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/tokens/decentralized-exchange/automated-market-makers"},"children":["AMMs"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Compliance-gated trading"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/tokens/decentralized-exchange/permissioned-dexes"},"children":["Permissioned DEXes"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/references/protocol/transactions/types"},"children":["Transaction Types"]}," for a comprehensive list of built-in transaction types. Some primitives depend on recently enabled ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/networks-and-servers/amendments"},"children":["amendments"]},", so be sure to check the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/resources/known-amendments"},"children":["amendment status"]}," on your target network before you design around it. For logic that doesn't map to a primitive, such as custom business rules, you still need off-ledger code."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"2-choose-your-infrastructure-path","__idx":2},"children":["2. Choose Your Infrastructure Path"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Once you've mapped the capabilities to XRP Ledger primitives, you have to decide how to connect to the network. You can choose one of two paths, depending on your infrastructure experience and custody preferences:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Custodian integration:"]}," Your provider's API handles keys, signing, submission, and node access in the background. Lowest security load and fastest integration, but provides least control over funds and features, vendor lock-in, and potential compliance implications."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Direct XRP Ledger integration:"]}," You hold your own keys and use a ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/references/client-libraries"},"children":["client library"]}," to interact with the XRP Ledger. Choose one of the following methods:",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Managed node provider:"]}," Fastest way to ship with low upfront costs. Someone else runs the nodes while you hold your keys and signing. Provides less control over ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/networks-and-servers/ledger-history"},"children":["history retention"]},", query privacy, and configuration, and you depend on their SLA."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Self-hosted ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/networks-and-servers/xrpld-server-modes"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["xrpld"]}]}," and ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/networks-and-servers/the-clio-server"},"children":["Clio"]}," servers:"]}," Most control over ledger history, query privacy, and throughput, without third-party dependencies. Requires high operational overhead for hardware and maintaining synced servers. Suited to teams with higher volume or strict SLA needs. See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/infrastructure"},"children":["Install and Run"]},"."]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For more information, see the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/use-cases/payments"},"children":["payments overview"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"pick-a-client-library","__idx":3},"children":["Pick a Client Library"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["After selecting your infrastructure, decide which ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/references/client-libraries"},"children":["library"]}," you'll use. The library builds, signs, and submits native transactions and reads the ledger state, so there is no smart-contract layer to call. If you use a custodian integration, the custodian's API is typically your client library, so you can skip ahead to ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#4-build-your-integration"},"children":["Step 4"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The best place to start is by matching the library to your backend's primary language. XRPLF maintains ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["xrpl.js"]}," (JavaScript/TypeScript), ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["xrpl-py"]}," (Python), and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["xrpl4j"]}," (Java). You can use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["xrpl.js"]}," if you currently build with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["viem"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ethers"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["xrpl-py"]}," if you build with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["web3.py"]},", or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["xrpl4j"]}," if you build with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["web3j"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Other libraries, such as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["xrpl-go"]}," (Go) and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["XRPL_PHP"]}," (PHP), vary in release cadence and amendment support. Check the repositories for recent releases and confirm they support the amendments and features your integration needs before committing to one."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you don't find a library that matches your backend, you can connect to the XRP Ledger using the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/references/http-websocket-apis"},"children":["HTTP / WebSocket APIs"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"3-set-up-your-accounts","__idx":4},"children":["3. Set Up Your Accounts"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["With your chosen client library, you can create and fund the accounts your integration will use to submit transactions and hold balances. On the XRP Ledger, a few things about accounts work differently:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["An account doesn't exist until it's funded. You can generate a ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/accounts/cryptographic-keys"},"children":["key pair"]}," offline, but the address isn't active on the ledger until it receives the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/accounts/reserves"},"children":["base reserve"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Its reserve has two parts: a fixed ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/accounts/reserves"},"children":["base reserve"]}," every account holds, plus an owner reserve that adds a set amount for each ledger entry it owns (for example, a trust line, offer, or escrow). You can't spend below the two combined, which doubles as one of the ledger's anti-spam mechanisms."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Each account must opt in to a token before it can receive it, unlike many EVM chains where tokens can arrive unsolicited. If the issuer requires authorization, they must also approve the holder. Every opt-in creates a ledger entry that adds to the account's ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/accounts/reserves#owner-reserves"},"children":["owner reserve"]},". The way an account opts in depends on the token type:",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Trust Line Tokens"]},": The account creates a trust line to the issuer with a ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/references/protocol/transactions/types/trustset"},"children":["TrustSet transaction"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["MPTs"]},": The account sends an ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/references/protocol/transactions/types/mptokenauthorize"},"children":["MPTokenAuthorize transaction"]},"."]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Other chains frequently use one deposit address per customer, while the XRP Ledger uses ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/transactions/source-and-destination-tags"},"children":["destination tags"]}," to route an incoming payment to the correct customer in a single shared (omnibus) account. Since every address needs its own reserve, one account per customer ties up XRP for each customer (see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#receive-and-credit"},"children":["Receive and Credit"]},")."]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Note"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you use a custodian integration, your custodian creates and manages these accounts and keys. The rest of this section only applies when you hold your own keys."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"fund-your-account","__idx":5},"children":["Fund Your Account"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can fund accounts on Testnet and Devnet using a ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/resources/dev-tools/xrp-faucets"},"children":["faucet"]},". On ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/networks-and-servers/parallel-networks"},"children":["Mainnet"]},", you fund an account by sending it XRP from an exchange or an already-funded account. See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/accounts"},"children":["Accounts"]}," for more on account creation and configuration."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["On a test network, creating and funding an account is a single call (in Python, import ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["generate_faucet_wallet"]}," from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["xrpl.wallet"]},"):"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"JavaScript","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"file":"/_code-samples/multisigning/js/set-up-multi-signing.js","language":"js","header":{"controls":{"copy":{}}},"lang":"js","source":"import xrpl from 'xrpl'\n\nconst client = new xrpl.Client('wss://s.altnet.rippletest.net:51233')\nawait client.connect()\n\nconsole.log('Funding new wallet from faucet...')\nconst { wallet } = await client.fundWallet()\nconsole.log(`Funded. Master key pair:\n  Address: ${wallet.address}\n  Seed: ${wallet.seed}\n`)"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Python","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"file":"/_code-samples/multisigning/py/set-up-multi-signing.py","language":"py","header":{"controls":{"copy":{}}},"lang":"py","source":"client = JsonRpcClient(\"https://s.altnet.rippletest.net:51234\")\n\nprint(\"Funding new wallet from faucet...\")\nwallet = generate_faucet_wallet(client)\nprint(f\"\"\"Funded. Master key pair:\n  Address: {wallet.address}\n  Seed: {wallet.seed}\n\"\"\")"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning","name":"Caution"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This example handles seeds directly to keep the Testnet example simple. In production, never log or hardcode a seed. Store it in a secret manager and use ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/transactions/secure-signing"},"children":["secure signing"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"plan-account-roles-and-keys","__idx":6},"children":["Plan Account Roles and Keys"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You might separate roles across multiple accounts, using a treasury for reserves and balances, operating accounts for submission, and a ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/accounts/multi-signing"},"children":["SignerList"]}," where an account needs multi-party control. Because these accounts hold real funds and on-ledger actions are irreversible, protect their keys from the start:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Generate each master key pair with ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/tutorials/best-practices/key-management/offline-account-setup"},"children":["offline account setup"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Operate through a ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/tutorials/best-practices/key-management/assign-a-regular-key-pair"},"children":["regular key"]},", and keep the offline master key as your recovery path."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Optionally, ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/tutorials/best-practices/key-management/disable-master-key-pair"},"children":["disable the master key"]}," if you want transactions signed only by a regular key or multi-signing. Confirm that your regular key or signer list works first, because disabling the master key removes the default way to authorize transactions and your offline recovery path."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"4-build-your-integration","__idx":7},"children":["4. Build Your Integration"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Now that your accounts are funded, you can port your business logic into built-in transaction types."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Note"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you use a custodian integration, your custodian's API replaces the client library calls in the code samples below, so you don't build, sign, or submit transactions yourself. The concepts still apply, so check your custodian's documentation for how it reports transaction results, partial payments, and incoming payments."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Some concepts you may know from other chains work like this on the XRP Ledger:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Concept from Other Chains"},"children":["Concept from Other Chains"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"XRP Ledger Field"},"children":["XRP Ledger Field"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Nonce"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/references/protocol/data-types/basic-data-types#account-sequence"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Sequence"]}]}," numbers order transactions serially per account."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Gas"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/transactions/transaction-cost"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Fee"]}]}," is a low base cost that rises with network load."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Mempool"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/transactions/reliable-transaction-submission"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["LastLedgerSequence"]}]}," bounds how long a transaction stays pending. After that ledger, the transaction expires and can never be applied."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Retries"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/references/protocol/data-types/basic-data-types#account-sequence"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Sequence"]}]}," makes a resubmitted transaction apply at most once."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For more on how these fields work together, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/transactions/reliable-transaction-submission"},"children":["Reliable Transaction Submission"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"send-a-payment","__idx":8},"children":["Send a Payment"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This example runs the entire payment lifecycle by autofilling ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Fee"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Sequence"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["LastLedgerSequence"]},", signing locally, submitting, and waiting for a validated result before reading the outcome from the metadata."]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"JavaScript","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"file":"/_code-samples/send-xrp/js/send-xrp.js","language":"js","header":{"controls":{"copy":{}}},"lang":"js","source":"  // Prepare transaction -------------------------------------------------------\n  const prepared = await client.autofill({\n    \"TransactionType\": \"Payment\",\n    \"Account\": wallet.address,\n    \"DeliverMax\": xrpl.xrpToDrops(\"22\"),\n    \"Destination\": \"rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe\"\n  })\n  const max_ledger = prepared.LastLedgerSequence\n  console.log(\"Prepared transaction instructions:\", prepared)\n  console.log(\"Transaction cost:\", xrpl.dropsToXrp(prepared.Fee), \"XRP\")\n  console.log(\"Transaction expires after ledger:\", max_ledger)\n\n  // Sign prepared instructions ------------------------------------------------\n  const signed = wallet.sign(prepared)\n  console.log(\"Identifying hash:\", signed.hash)\n  console.log(\"Signed blob:\", signed.tx_blob)\n\n  // Submit signed blob --------------------------------------------------------\n  const tx = await client.submitAndWait(signed.tx_blob)\n\n  // Wait for validation -------------------------------------------------------\n  // submitAndWait() handles this automatically, but it can take 4-7s.\n\n  // Check transaction results -------------------------------------------------\n  console.log(\"Transaction result:\", tx.result.meta.TransactionResult)\n  console.log(\"Balance changes:\", JSON.stringify(xrpl.getBalanceChanges(tx.result.meta), null, 2))\n\n  "},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Python","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"file":"/_code-samples/send-xrp/py/send-xrp.py","language":"py","header":{"controls":{"copy":{}}},"lang":"py","source":"# Prepare transaction ----------------------------------------------------------\nmy_payment = xrpl.models.transactions.Payment(\n    account=test_wallet.address,\n    amount=xrpl.utils.xrp_to_drops(22),\n    destination=\"rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe\",\n)\nprint(\"Payment object:\", my_payment)\n\n# Sign transaction -------------------------------------------------------------\nsigned_tx = xrpl.transaction.autofill_and_sign(\n        my_payment, client, test_wallet)\nmax_ledger = signed_tx.last_ledger_sequence\ntx_id = signed_tx.get_hash()\nprint(\"Signed transaction:\", signed_tx)\nprint(\"Transaction cost:\", xrpl.utils.drops_to_xrp(signed_tx.fee), \"XRP\")\nprint(\"Transaction expires after ledger:\", max_ledger)\nprint(\"Identifying hash:\", tx_id)\n\n# Submit transaction -----------------------------------------------------------\ntry:\n    tx_response = xrpl.transaction.submit_and_wait(signed_tx, client)\nexcept xrpl.transaction.XRPLReliableSubmissionException as e:\n    exit(f\"Submit failed: {e}\")\n\n# Wait for validation ----------------------------------------------------------\n# submit_and_wait() handles this automatically, but it can take 4-7s.\n\n# Check transaction results ----------------------------------------------------\nimport json\nprint(json.dumps(tx_response.result, indent=4, sort_keys=True))\nprint(f\"Explorer link: https://testnet.xrpl.org/transactions/{tx_id}\")\nmetadata = tx_response.result.get(\"meta\", {})\nif metadata.get(\"TransactionResult\"):\n    print(\"Result code:\", metadata[\"TransactionResult\"])\nif metadata.get(\"delivered_amount\"):\n    print(\"XRP delivered:\", xrpl.utils.drops_to_xrp(\n                metadata[\"delivered_amount\"]))\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning","name":"Caution"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This example handles seeds directly to keep the Testnet example simple. In production, never log or hardcode a seed. Store it in a secret manager and use ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/transactions/secure-signing"},"children":["secure signing"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"convert-across-currencies","__idx":9},"children":["Convert Across Currencies"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/payment-types/cross-currency-payments"},"children":["Cross-currency payments"]}," follow the same lifecycle as sending payments, with two differences:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Amount"]}," names the currency and issuer the destination receives (this differs from what the source spends)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SendMax"]}," caps the source spend."]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Note"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Cross-currency payments currently support only XRP and trust line tokens. MPTs require the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/resources/known-amendments#mptokensv2"},"children":["MPTokensV2 amendment"]},", which is still in development."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Both the sending and receiving accounts need a ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/tokens/fungible-tokens/trust-line-tokens"},"children":["trust line"]}," to the issuer of any non-XRP currency they handle. Issuers can restrict who holds their currency with ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/tokens/fungible-tokens/authorized-trust-lines"},"children":["authorized trust lines"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["By default, a payment converts directly through the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/tokens/decentralized-exchange"},"children":["DEX"]}," order book or ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/tokens/decentralized-exchange/automated-market-makers"},"children":["AMM"]}," between the two currencies. For better routes, including ones ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/tokens/decentralized-exchange/autobridging"},"children":["bridged through XRP"]},", pass the result of ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/references/http-websocket-apis/public-api-methods/path-and-order-book-methods/ripple_path_find"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ripple_path_find"]}]}," in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Paths"]},". There's no external router to integrate."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["On-chain conversion draws on both the order book and the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/tokens/decentralized-exchange/automated-market-makers"},"children":["AMM"]},", and ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/tokens/fungible-tokens/paths"},"children":["pathfinding"]}," estimates the route rather than guaranteeing it. Bound each conversion: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SendMax"]}," caps what the source spends, and a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["DeliverMin"]}," with the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/payment-types/partial-payments"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tfPartialPayment"]}]}," flag floors what the destination receives."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following example spends XRP and delivers USD to the destination, with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SendMax"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["DeliverMin"]}," set:"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"JavaScript","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"file":"/_code-samples/cross-currency-payment/js/sendCrossCurrency.js","language":"js","header":{"controls":{"copy":{}}},"lang":"js","source":"// Prepare cross-currency Payment ----------------------\n// Deliver 100 USD to the receiver while spending no more than 30 XRP from the\n// source. The ledger routes XRP -> USD through the DEX automatically, so there\n// is no router to integrate. SendMax caps what the source spends. DeliverMin,\n// together with the tfPartialPayment flag, floors what the destination receives.\nconsole.log(`\\n=== Preparing cross-currency Payment ===\\n`)\nconst paymentTx = {\n  TransactionType: 'Payment',\n  Account: sender.address,\n  Destination: receiverAddress,\n  Amount: { currency, issuer: issuerAddress, value: '100' },\n  SendMax: xrpl.xrpToDrops('30'),\n  DeliverMin: { currency, issuer: issuerAddress, value: '95' },\n  Flags: 131072 // tfPartialPayment\n}\n\nxrpl.validate(paymentTx)\nconsole.log(JSON.stringify(paymentTx, null, 2))\n\n// Submit, sign, and wait for validation ----------------------\nconsole.log(`\\n=== Submitting cross-currency Payment ===\\n`)\nconst response = await client.submitAndWait(paymentTx, { wallet: sender, autofill: true })\n\nconst resultCode = response.result.meta.TransactionResult\nif (resultCode !== 'tesSUCCESS') {\n  console.error('Error: payment failed with', resultCode)\n  await client.disconnect()\n  process.exit(1)\n}\n\n// Credit the amount that ACTUALLY arrived, from metadata, never the Amount field\nconsole.log(`\\n=== Payment delivered ===\\n`)\nconsole.log('delivered_amount:', response.result.meta.delivered_amount)\n// "},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Python","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"file":"/_code-samples/cross-currency-payment/py/send_cross_currency.py","language":"py","header":{"controls":{"copy":{}}},"lang":"py","source":"# Prepare cross-currency Payment ----------------------\n# Deliver 100 USD to the receiver while spending no more than 30 XRP from the\n# source. The ledger routes XRP -> USD through the DEX automatically, so there\n# is no router to integrate. SendMax caps what the source spends. DeliverMin,\n# together with the tfPartialPayment flag, floors what the destination receives.\nprint(\"\\n=== Preparing cross-currency Payment ===\\n\")\npayment_tx = Payment(\n    account=sender.address,\n    destination=receiver_address,\n    amount=IssuedCurrencyAmount(\n        currency=currency,\n        issuer=issuer_address,\n        value=\"100\",\n    ),\n    send_max=xrp_to_drops(30),\n    deliver_min=IssuedCurrencyAmount(\n        currency=currency,\n        issuer=issuer_address,\n        value=\"95\",\n    ),\n    flags=[PaymentFlag.TF_PARTIAL_PAYMENT],\n)\n\nprint(json.dumps(payment_tx.to_xrpl(), indent=2))\n\n# Submit, sign, and wait for validation ----------------------\nprint(\"\\n=== Submitting cross-currency Payment ===\\n\")\nresponse = submit_and_wait(payment_tx, client, sender)\n\nresult_code = response.result[\"meta\"][\"TransactionResult\"]\nif result_code != \"tesSUCCESS\":\n    print(f\"Error: payment failed with {result_code}\")\n    sys.exit(1)\n\n# Credit the amount that ACTUALLY arrived, from metadata, never the Amount field\nprint(\"\\n=== Payment delivered ===\\n\")\nprint(\"delivered_amount:\", response.result[\"meta\"][\"delivered_amount\"])\n# "},"children":[]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A cross-currency payment can also name a ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/tokens/decentralized-exchange/permissioned-dexes"},"children":["domain ID"]}," to keep the conversion from trading against accounts you haven't approved, by consuming only offers from the matching permissioned DEX. An account can trade in a domain if it owns the domain or holds a ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/tutorials/compliance-features/manage-credentials"},"children":["credential"]}," that the domain accepts. A payment that names a domain ID can't use AMM liquidity, so it has less to draw on than an unrestricted conversion."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"receive-and-credit","__idx":10},"children":["Receive and Credit"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Your stack also has to detect payments arriving in your accounts and credit the correct customer. Subscribe to your accounts with ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/references/http-websocket-apis/public-api-methods/subscription-methods/subscribe#transaction-streams"},"children":["transaction streams"]}," to see payments as they validate. For production monitoring, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/payment-types/robustly-monitoring-for-payments"},"children":["Robustly Monitoring for Payments"]},"."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning","name":"Caution"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Avoid three common mistakes that can cause you to credit the wrong amount or the wrong customer:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Credit the amount that actually arrived."]}," A ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/payment-types/partial-payments"},"children":["partial payment"]}," can deliver less than the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Amount"]}," field shows. Read the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["delivered_amount"]}," metadata field, not ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Amount"]},", to avoid the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/payment-types/partial-payments#partial-payments-exploit"},"children":["partial payments exploit"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Attribute pooled funds with destination tags."]}," When many customers share one treasury or operating account, require ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/transactions/source-and-destination-tags"},"children":["destination tags"]}," with ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/tutorials/compliance-features/require-destination-tags"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["RequireDest"]}]}," so each payment maps to the right customer."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Only credit successful transactions."]}," Validated ledgers include ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tec"]}," results, which are final and consume the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Fee"]}," but deliver nothing. Credit a customer only when the result is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tesSUCCESS"]},"."]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"supply-liquidity","__idx":11},"children":["Supply Liquidity"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you supply the liquidity that payments consume, you can publish and manage your own offers on the DEX (see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/tutorials/defi/dex/trade-in-the-decentralized-exchange"},"children":["Trade in the Decentralized Exchange"]},"). Each offer you leave in the ledger counts toward your ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/accounts/reserves#owner-reserves"},"children":["owner reserve"]},". Issuers can also set a ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/tokens/decentralized-exchange/ticksize"},"children":["tick size"]}," that limits the precision of your offers' exchange rates."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can also supply liquidity passively by depositing into an ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/tokens/decentralized-exchange/automated-market-makers"},"children":["AMM"]}," pool."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"5-test-on-testnet-or-devnet","__idx":12},"children":["5. Test on Testnet or Devnet"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Before going live, complete your end-to-end testing on a public test network:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/networks-and-servers/parallel-networks"},"children":["Testnet"]},": Closely mirrors Mainnet's amendment status and behavior. Primary environment for pre-launch validation."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/networks-and-servers/parallel-networks"},"children":["Devnet"]},": Runs beta releases, so use it only to test pre-release features or amendments that are not yet on Mainnet."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Neither test network uses real money, but both are usually centralized and come with no stability guarantees. Don't rely on persistence or treat them like stable environments."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Then, test how your integration handles XRP Ledger-specific cases that can cause failed, stuck, or misattributed payments, such as:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Crediting ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["delivered_amount"]}," on partial payments."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Attributing pooled funds with destination tags."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Enforcing reserve and trust line limits."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Holding ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SendMax"]},"/",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["DeliverMin"]}," under thin liquidity."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Clearing submissions when the fee rises under load."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A validated ledger includes both successful transactions and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tec"]}," failures. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tesSUCCESS"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tec"]}," ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/references/protocol/transactions/transaction-results"},"children":["result codes"]}," are both final and consume the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Fee"]},", but only ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tesSUCCESS"]}," means the transaction succeeded."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If a transaction expires without validation, build a replacement with the same ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Sequence"]}," and a new ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["LastLedgerSequence"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"6-pilot-a-live-corridor-and-launch","__idx":13},"children":["6. Pilot a Live Corridor and Launch"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["After testing on Testnet or Devnet, run a live pilot with real traffic through one narrow corridor (or a single partner), and verify results against your internal records before scaling."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To do so:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Switch your endpoint from a test network to Mainnet, and use funded accounts."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Send real transactions through the same lifecycle (see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#4-build-your-integration"},"children":["Build Your Integration"]},") and verify each one reached a validated ledger."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Verify on-ledger results against your internal records. Reconcile with ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/references/http-websocket-apis/public-api-methods/account-methods/account_tx"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["account_tx"]}]},", using ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["marker"]}," to page through results. Make reconciliation idempotent so replaying a ledger range never double-counts. Subscribe to ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/references/http-websocket-apis/public-api-methods/subscription-methods/subscribe#transaction-streams"},"children":["transaction streams"]}," for real-time monitoring instead of polling (see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/payment-types/robustly-monitoring-for-payments"},"children":["Robustly Monitoring for Payments"]},")."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Enforce any KYC or travel-rule obligations for the corridor. For example, use ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/tutorials/compliance-features/manage-credentials"},"children":["credentials"]}," to attest a holder's verified status on-ledger."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Widen scope once verified. If reconciliation fails, delay the cutover and keep your existing rail live as the fallback."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Once a transaction is in a validated ledger, it's immutable and can't be reversed, so there's no probabilistic-settlement tail to account for (see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/transactions/finality-of-results"},"children":["Finality of Results"]},")."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Your custody model impacts the way you cut over:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Custodial setups switch in a single window: snapshot your balances, fund the accounts on the XRP Ledger with the tokens you plan to hold (see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/tokens/fungible-tokens/stablecoins"},"children":["Stablecoins"]},"), and flip the payment engine."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Self-custodial flows rely on end users who move their own balances, so plan for a longer arc. Customer communication is usually the slowest piece."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Once your pilot cleanly reconciles, you have a repeatable path to map the stack, choose infrastructure, set up accounts, build, test, and pilot. Use the same path for each additional corridor."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"see-also","__idx":14},"children":["See Also"]},{"$$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":"MarkdownLink","attributes":{"href":"/docs/concepts/payment-types/cross-currency-payments"},"children":["Cross-Currency Payments"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/tokens/decentralized-exchange"},"children":["Decentralized Exchange"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/accounts/multi-signing"},"children":["Multi-Signing"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/tokens/fungible-tokens/stablecoins"},"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":"MarkdownLink","attributes":{"href":"/docs/tutorials/get-started/get-started-javascript"},"children":["Get Started with the XRP Ledger"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/tutorials/best-practices/key-management/send-a-multi-signed-transaction"},"children":["Send a Multi-Signed Transaction"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/tutorials/defi/dex/trade-in-the-decentralized-exchange"},"children":["Trade in the Decentralized Exchange"]}]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["References:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/references/protocol/transactions/types"},"children":["Transaction Types"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/references/client-libraries"},"children":["Client Libraries"]}]}]}]}]}]},"headings":[{"value":"Migrate a Payments or FX Stack to the XRP Ledger","id":"migrate-a-payments-or-fx-stack-to-the-xrp-ledger","depth":1},{"value":"1. Map Your Stack to XRP Ledger Primitives","id":"1-map-your-stack-to-xrp-ledger-primitives","depth":2},{"value":"2. Choose Your Infrastructure Path","id":"2-choose-your-infrastructure-path","depth":2},{"value":"Pick a Client Library","id":"pick-a-client-library","depth":3},{"value":"3. Set Up Your Accounts","id":"3-set-up-your-accounts","depth":2},{"value":"Fund Your Account","id":"fund-your-account","depth":3},{"value":"Plan Account Roles and Keys","id":"plan-account-roles-and-keys","depth":3},{"value":"4. Build Your Integration","id":"4-build-your-integration","depth":2},{"value":"Send a Payment","id":"send-a-payment","depth":3},{"value":"Convert Across Currencies","id":"convert-across-currencies","depth":3},{"value":"Receive and Credit","id":"receive-and-credit","depth":3},{"value":"Supply Liquidity","id":"supply-liquidity","depth":3},{"value":"5. Test on Testnet or Devnet","id":"5-test-on-testnet-or-devnet","depth":2},{"value":"6. Pilot a Live Corridor and Launch","id":"6-pilot-a-live-corridor-and-launch","depth":2},{"value":"See Also","id":"see-also","depth":2}],"frontmatter":{"seo":{"description":"Learn how to migrate your payments or FX stack to the XRP Ledger.","title":"Migrate a Payments or FX Stack to the XRP Ledger"},"labels":["Payments","Cross-Currency"]},"editPage":{"to":"https://github.com/XRPLF/xrpl-dev-portal/tree/master/docs/use-cases/payments/migrate-a-payments-or-fx-stack-to-the-xrp-ledger.md"},"lastModified":"2026-11-05T15:18:22.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/docs/use-cases/payments/migrate-a-payments-or-fx-stack-to-the-xrp-ledger","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}