Send Confidential MPT Payments
This tutorial shows how to send a confidential Multi-Purpose Token (MPT) payment, where the amount sent is encrypted instead of being publicly visible. In the example, two confidential payments settle together in one Batch transaction.
- Section
- Tutorials
What you will do
A seller sends a tokenized fund and a buyer pays for it with a different token, for example a stablecoin. An orchestrator, a third party such as an exchange, coordinates the two payments. It settles both together, so if either side fails the whole transaction reverts. The orchestrator never knows the amounts involved.
What you need
You need a basic understanding of the XRP Ledger and of Confidential Transfers. You need two accounts that each hold a confidential balance of a different MPT, with their encryption public keys registered on the ledger. The tutorial's setup script creates them for you. The examples use xrpl.js and xrpl-py. The feature requires the ConfidentialTransfer amendment.
The steps in short
Each holder first submits a ConfidentialMPTMergeInbox transaction. It moves funds from ConfidentialBalanceInbox to ConfidentialBalanceSpending, the only balance a confidential payment can spend from. A helper function then prepares each ConfidentialMPTSend transaction. It encrypts the amount and generates a Zero-Knowledge Proof, in the ZKProof field, that the ledger validates the transfer against. Both payments go into a Batch transaction with the tfAllOrNothing flag. The seller and buyer each sign for their own inner payment, and the orchestrator submits it. Afterwards you check each inner result, merge the received amounts and decrypt the balances.
Good to know
The proof is bound to the sender's sequence number. So submit nothing else from either account between preparing the payments and submitting the Batch. Inner transactions must have a Fee of 0, and the outer Batch pays for everything inside it. A tesSUCCESS on the Batch only means the Batch itself was well-formed, so verify each inner payment. Only the two holders and the auditor can decrypt amounts, each with its own encryption private key.
Source: xrpl.org. Read 6 December 2026.
Zerpedia states what the source says, in plain words, and gives no opinion. How Zerpedia is made