Amendment XLS: Confidential Transfers for MPTs on XRPL #372
Replies: 6 comments 9 replies
-
|
First comment. We are excited to use XRPL with our app GeorgieJobs. |
Beta Was this translation helpful? Give feedback.
-
|
There’s an existing amendment called |
Beta Was this translation helpful? Give feedback.
-
|
We can use |
Beta Was this translation helpful? Give feedback.
-
|
I’m trying to understand how flexible the selective-disclosure mechanism 1 is in practice. Specifically: How many distinct auditor roles can be supported? Who formally controls which auditors get access to the read-only encrypted balance view and can they revoke the audit keys? |
Beta Was this translation helpful? Give feedback.
-
|
Should this be moved to standards? It's been in discussions for some time. |
Beta Was this translation helpful? Give feedback.
-
|
Is there a way to apply a Confidential protocol as an option to XRP payments/transfers/balances either in and/or out of a Permissioned Domain? If not please explain why? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
title: Confidential Transfers for MPTs on XRPL description: This amendment introduces Confidential Multi-Purpose Tokens (MPTs) on the XRP Ledger. author: Murat Cenk (mcenk@ripple.com) and Aanchal Malhotra (amalhotra@ripple.com) status: Discussion category: Amendment created: 2025-09-12Confidential Transfers for MPTs on XRPL
1. Abstract
This specification introduces Confidential Multi-Purpose Tokens (MPTs) on the XRP Ledger. Confidential MPTs provide confidential transfers and balances using EC-ElGamal encryption and Zero-Knowledge Proofs (ZKPs), while preserving XLS-33 semantics:
This design aligns naturally with XLS-33 by keeping OutstandingAmount defined as the sum of all non-issuer balances. Supply consistency is enforced directly by validators, and confidentiality is achieved at the transaction level through equality and range proofs.
2. Motivation
XLS-33 enables flexible tokenization on the XRP Ledger, but all balances and transfers remain publicly visible. This transparency limits adoption in institutional and privacy-sensitive contexts. Confidential MPTs address this gap by introducing encrypted balances and confidential transfers while preserving XLS-33 semantics.
The design uses a second-account model, where the issuer maintains a designated account treated as a regular holder. This keeps the definition of OutstandingAmount (OA) exactly as in XLS-33, the sum of all non-issuer balances, now including the issuer’s second account. A complementary value, ConfidentialOutstandingAmount (COA), tracks the confidential portion of circulation and MaxAmount (MA) continues to cap supply. By modeling confidential issuance through the second account rather than redefining OA, validators can enforce supply consistency with the existing invariant OA ≤ MA.
Benefits
3. Scope
This XLS specifies the protocol changes required to support confidential MPTs, including:
New Transaction Types
New Ledger Fields and Objects
MPTokenIssuance Extensions: To support confidential MPTs, the MPTokenIssuance ledger object is extended with two new flags and three new fields. These serve as the global configuration and control settings for the token's confidential features.
New Flags:
New Fields:
Managing Confidentiality Settings via MPTokenIssuanceSet:
The MPTokenIssuanceSet transaction is used by the issuer to manage the lsfConfidential flag and associated fields.
MPToken Extensions: Extends per-account MPT objects with confidential balance fields:
Proof System
The protocol relies on a ZKP system to validate confidential transactions without revealing sensitive data. Key proofs include:
4. Definitions & Terminology
MPT (Multi-Purpose Token): A token standard defined by XLS-33. Extended here to support confidential balances and transfers.
MPTokenIssuance (Object): Ledger object storing metadata for an MPT, including Currency, Issuer, MaxAmount (MA), and OutstandingAmount (OA).
MPToken (Object): Ledger object representing a holder’s balance of a given MPT. Extended to include confidential balance fields:
Second Account (Issuer-as-Holder): A designated account controlled by the issuer but treated as a holder.
OutstandingAmount (OA): Total of all non-issuer balances (public + confidential), including the issuer’s second account.
ConfidentialOutstandingAmount (COA): Total of all confidential balances of non-issuers, including the issuer’s second account.
MaxAmount (MA): Maximum allowed token supply. Invariant: OA ≤ MA.
EC-ElGamal Encryption: Public-key encryption scheme with additive homomorphism. Used for encrypted balances and homomorphic updates.
Balance Proofs: ZKPs proving that confidential transfers are valid:
Split-Balance Model: Confidential balances divided into:
Auditor Policy: Optional issuance-level configuration that allows balances to be encrypted under an auditor’s key for selective disclosure.
Clawback: A privileged process initiated by the issuer via a ConfidentialMPTClawback transaction. It uses a ZKP to verifiably prove a holder's total confidential balance directly into the issuer's public reserve, ensuring the ledger's accounting remains consistent.
5. Protocol Overview
The Confidential MPT protocol is built on three core design principles: the Issuer Second Account model, the Split-Balance Model for reliable transfers, and a Multi-Ciphertext Architecture for privacy and compliance.
The Issuer Second Account Model: To introduce confidential tokens without altering the fundamental supply rules of XLS-33, the protocol uses an issuer-controlled second account. This account is treated by the ledger as a standard, non-issuer holder.
The Split-Balance Model: To solve the "stale proof" problem where an incoming transfer could invalidate a user's just-created proof for an outgoing transfer. Each account's confidential balance is split into two parts:
The Multi-Ciphertext Architecture: A single confidential balance is represented by multiple parallel ciphertexts, each serving a distinct purpose. ZK equality proofs are the cryptographic glue that guarantees all of these ciphertexts represent the exact same hidden amount.
6. Transaction Types
ConfidentialMPTConvert
Purpose: It converts a visible (public) MPT balance into its confidential form. The converted amount is typically credited to the holder’s Inbox (CB_IN) to avoid immediate staleness, requiring the receiver to later merge these funds into their Spending (CB_S) balance. It acts as the mechanism for an account to "opt-in" or initialize their participation in the confidential MPT system. By executing this transaction (even with a zero-amount conversion), a holder's unique HolderElGamalPublicKey is recorded on their MPToken object, making them eligible to receive and manage confidential funds. When used by an issuer to fund their designated second account, this transaction explicitly discloses the plaintext Amount while delivering confidential value to the second account (treated as a holder). In all cases, both OutstandingAmount (OA) and ConfidentialOutstandingAmount (COA) are accurately maintained in plaintext.
Use Cases
Transaction Fields
Ledger Changes
Validator Checks
The validator performs common checks first, then applies path-specific rules based on whether the Account initiating the transaction is the Issuer.
Example A — Holder converts 150 units (default → Inbox)
{ "TransactionType": "ConfidentialMPTConvert", "Account": "rBob", "Issuer": "rAlice", "Currency": "USD", "Amount": "150", "HolderElGamalPublicKey": "pkBob...", "EncryptedAmountForHolder": { "A": "...", "B": "..." }, "EncryptedAmountForIssuer": { "A": "...", "B": "..." }, "ZKProof": { "zkp_bytes_here" } }Example B — Issuer funds second account confidentially
{ "TransactionType": "ConfidentialMPTConvert", "Account": "rAlice", "Issuer": "rAlice", "Currency": "USD", "Amount": "500", "Receiver": "rIssuerSecondAcct", "ReceiverElGamalPublicKey": "pkSecond...", "EncryptedAmountForHolder": { "A": "...", "B": "..." }, "EncryptedAmountForIssuer": { "A": "...", "B": "..." }, "ZKProof": { "zkp_bytes_here" } }ConfidentialMPTSend
Purpose: Confidential transfer of MPT value between accounts while keeping the amount hidden. Receiver is credited to Inbox (CB_IN) to avoid staleness; the receiver later merges to Spending (CB_S).
Use Cases
Transaction Fields
Ledger Changes
The ConfidentialMPTSend transaction modifies the confidential balances of both the sender and the receiver, and critically updates the issuer's confidential tracking (EncryptedBalanceIssuer) on both the sender's and receiver's MPToken objects.
Validator Checks
Prerequisites and Account Rules: These are foundational checks to ensure the transaction is valid in its context.
Field Presence and Formatting: These checks validate the structure and content of the transaction itself.
ZKP Verification: The validator must confirm that the ZKProof correctly proves all of the following:
Example — Holder → Holder (with auditor)
{ "TransactionType": "ConfidentialMPTSend", "Account": "rBob", "Issuer": "rAlice", "Currency": "USD", "Receiver": "rCarol", "EncryptedAmountForSender": { "A": "...", "B": "..." }, "EncryptedAmountForReceiver": { "A": "...", "B": "..." }, "EncryptedAmountForIssuer": { "A": "...", "B": "..." }, "EncryptedAmountForAuditor": { "A": "...", "B": "..." }, "AuditorPublicKey": "pkAuditor...", "ZKProof": "zkp_bytes_here" }Net effect: Public balances unchanged; confidential amount is redistributed (sender CB_S ↓, receiver CB_IN ↑). OA (plaintext) unchanged; COA (plaintext) unchanged.
ConfidentialMPTMergeInbox
Purpose: Moves all funds from the inbox balance into the spending balance, then resets the inbox to a canonical encrypted zero (EncZero). This ensures that proofs reference only stable spending balances and prevents staleness from incoming transfers.
Use Cases
Transaction Fields
Ledger Changes
All updates are homomorphic; global supply fields like OutstandingAmount (OA) and ConfidentialOutstandingAmount (COA) are unaffected by this operation.
Validator Checks
Rationale & Safety
Canonical Encrypted Zero
To ensure inbox fields always contain a valid ciphertext after reset:
EncZero(Acct, Issuer, Curr): r = H("EncZero" || Acct || Issuer || Curr) mod n, curve order n
return (R = r·G, S = r·Pk), Pk: ElGamal public key of Acct
Example
{ "TransactionType": "ConfidentialMPTMergeInbox", "Account": "rBob", "Issuer": "rAlice", "Currency": "USD" }ConfidentialMPTConvertBack
Purpose: Convert confidential into public MPT value.
Accounting Effects:
Transaction Fields:
Ledger Changes
A) Holder path (Account ≠ IssuerSecondAccount)
Net: OA =, COA ↓, IPB =
B) Issuer second account path (Account = IssuerSecondAccount)
Net: OA ↓, COA ↓, IPB ↑
Validator Checks
Prerequisites and Basic Rules: These are the initial high-level checks for the transaction's context and validity.
Field Presence and Formatting: These checks validate the structure and content of the transaction itself before performing expensive cryptographic operations.
ZKP Verification: The validator must confirm that the ZKProof bundle correctly proves all of the following claims:
Example — Holder converts back 75 units
{ "TransactionType": "ConfidentialMPTConvertBack", "Account": "rBob", "Issuer": "rAlice", "Currency": "USD", "Amount": "75", "EncryptedAmountForAccount": { "A": "...", "B": "..." }, "EncryptedAmountForIssuer": { "A": "...", "B": "..." }, "ZKProofs": { "EqualityProof": { "Type": "CiphertextToPlainEqualityProof", "Proof": "zkp_bytes_here" }, "BalanceProof": { "Type": "RangeProof", "Proof": "zkp_bytes_here" } } }Edge Case Analysis (Low-Volume Transaction Flow): Alice, the issuer, converts 50 ConfidentialMPT into her second account, performs a single confidential send of 20 to Bob (a holder), and then executes a ConvertBack of 30.
Step 1. Issuer Convert (Alice → second account, 50)
Step 2. Confidential Send (Alice’s second account → Bob, amount 20)
Step 3. ConvertBack (Alice’s second account → issuer reserve, 30)
What outsiders can infer
Why no exact leakage
Note: This design allows tokens to move between public and private states. While the Convert and ConvertBack transactions show their amounts to provide this flexibility, they still protect the privacy of individual balances and transfers. Observers can only see the total change in circulation, not how the private supply is shared among holders. ElGamal randomization makes it impossible to tell the difference between accounts with zero balances. This ensures that outsiders cannot know if a specific account is empty or still holds private tokens.
ConfidentialMPTClawback
Clawback involves the issuer forcibly reclaiming funds from a holder's account. This action is fundamentally incompatible with standard confidential transfers, as the issuer does not possess the holder's private ElGamal key and therefore cannot generate the required ZKPs for a normal ConfidentialMPTSend. To solve this, the protocol introduces a single and privileged transaction that allows an issuer to verifiably reclaim funds in one uninterruptible step.
This issuer-only transaction is designed to convert a holder's entire confidential balance directly into the issuer's public reserve.
How the Clawback Process Works
This single transaction securely and verifiably moves the funds directly from the holder's confidential balance to the issuer's public reserve, ensuring the integrity of the ledger's public accounting is perfectly maintained.
MPTokenIssuanceSet - Confidential Side Effects
The standard MPTokenIssuanceSet transaction is used by an issuer to lock the public MPTs of a specific holder. To support confidential freezes without introducing a new transaction type, the logic of MPTokenIssuanceSet is extended with the following side effects. When a MPTokenIssuanceSet transaction is processed to lock or unlock a holder's public MPTs, validators must perform these additional checks and actions after all standard validation is complete.
Validator Logic Extension for MPTokenIssuanceSet
7. Auditability & Compliance
The Confidential MPT model is designed to provide robust privacy for individual transactions while ensuring both the integrity of the total token supply and a high degree of flexibility for regulatory compliance and auditing.
To achieve this balance, this protocol offers flexible auditability through two distinct mechanisms. The primary method is on-chain selective disclosure, where each confidential balance is dually encrypted under a designated auditor's public key, allowing for independent, trust-minimized verification. This model is also designed for dynamic, forward-looking compliance; if a new auditor or party requires access later, the issuer can re-encrypt existing balances under the new key and provide cryptographic equality proofs to grant them access without disrupting the system or sharing existing keys. As a simpler, trust-based alternative, the protocol also supports an issuer-mediated model using view keys. In this approach, the issuer controls a separate set of keys that provide read-only access and can be shared directly with auditors on an as-needed basis.
The technical foundation for both of these models is a multi-ciphertext architecture, where each confidential balance is maintained under several different public keys (e.g., holder, issuer, and optional auditor) to serve these distinct purposes.
Mechanism 1: On-Chain Selective Disclosure (A Trust-Minimized Approach)
The primary method for compliance is on-chain selective disclosure, which provides cryptographically enforced auditability directly on the ledger.
This powerful re-encryption capability enables targeted, on-demand compliance without ever sharing the issuer's private key or making user balances public.
Mechanism 2: Issuer-Mediated Auditing (A Simple View Key Model)
As a simpler, trust-based alternative, the protocol also supports an issuer-mediated model using view keys.
Foundational Elements for Public Integrity
Both compliance models are built upon foundational elements that ensure the integrity of the total token supply remains publicly verifiable at all times.
Example Audit Flows
8. Privacy Properties
Confidential MPT transactions are designed to minimize information leakage while preserving verifiability of supply and balances. Validators and external observers see only ciphertexts and ZKPs and never learn the underlying amounts except where amounts are already revealed in XLS-33 semantics.
Publicly Visible Information
Hidden Information
Transaction-Type Privacy Notes
9. Security Considerations
Confidential MPTs introduce cryptographic mechanisms that require careful validation and enforcement. This section summarizes key security invariants, proof requirements, and considerations against potential attack vectors.
Proof Requirements
Every confidential transaction must carry appropriate ZKPs:
Confidential Balance Consistency
Issuer Second Account Model
Privacy Guarantees
Auditor & Compliance Controls
Attack Surface & Mitigations
10. Analysis of Transaction Cost and Performance
The efficiency is critical to the viability of Confidential MPTs. This analysis compares potential methods for range proofs to determine their impact on transaction size and overall performance.
Foundational Assumptions
First, let's establish the size of our basic cryptographic building blocks.
We will use the ConfidentialMPTSend transaction as our benchmark, as its cryptographic payload is the most complex:
Option 1: Decomposition Range Proof
This method involves breaking the amount into its individual bits and generating a separate proof for each bit to show it is either 0 or 1. The proof size is linear to the number of bits.
1a: Using 64-bit Values
1b: Using 40-bit Values
Reducing the bit length provides a significant, but insufficient, size reduction.
Option 2: Bulletproofs
Bulletproofs are a modern ZKP system designed for efficiency, with proof sizes that grow logarithmically with the number of bits (O(logn)).
Using 64-bit Values
Summary
Bulletproofs are an efficient choice. Even when reducing the bit length, the decomposition approach results in a transaction payload that is over 6 times larger than a Bulletproof.
11. Frequently Asked Questions (FAQ)
This section addresses common questions about Confidential MPTs and their design choices, ranging from basic functionality to advanced research topics.
Q1. Can confidential and public balances coexist?
Yes, both issuers and holders may simultaneously maintain both public and confidential balances of the same MPT, fully supporting hybrid ecosystems with explicit conversions between the two using ConfidentialMPTConvert transactions.
Q2. Why introduce a separate Merge transaction?
A separate Merge transaction is introduced because incoming transfers could cause proofs to become stale if all balances were in a single field, while split balances (CB_S and CB_IN) isolate proofs to a stable spending balance, allowing the Merge transaction to consolidate funds deterministically and update the version counter without requiring a proof, making it cheap to validate.
Q3. What happens if a user forgets to merge their inbox?
If a user forgets to merge their inbox, incoming funds will accumulate in CB_IN, remaining safe but unable to be spent until they are consolidated into CB_S via a merge, therefore wallets are expected to perform this merge before a send if necessary.
Q4. Can confidential transactions be used in DEX, escrow, or checks?
No, this version of confidential MPT extensions focuses solely on regular confidential MPT payments between accounts, as integration with XRPL’s DEX, escrow, or checks would require further research into how to represent offers or locked balances without revealing their amounts.
Q5. How does compliance fit in?
Compliance is supported by storing each confidential balance as parallel ciphertexts under the holder’s key (CB_S/CB_IN), the issuer’s key (EncryptedBalanceIssuer), and an optional auditor’s key (EncryptedBalanceAuditor) if enabled, with ZKPs ensuring all ciphertexts encrypt the same value, allowing the public to verify supply limits via issuer ciphertexts and auditors to decrypt balances if permitted.
Q6. What happens if a holder loses their ElGamal private key?
If a holder loses their ElGamal private key, they will be unable to decrypt or spend their confidential balances, which will remain valid on-ledger but are effectively locked and irrecoverable by that holder.
Q7. What prevents replay or proof reuse?
Replay and proof reuse are prevented because all ZKPs are transcript-bound with domain separation, meaning the binding includes transaction type, issuer, currency, and version counters, so attempting to replay a proof in another context will result in a failed verification.
Q8. Are confidential transactions more expensive than standard MPT transactions?
Yes, confidential transactions are more expensive than standard MPT transactions as they include extra ciphertexts and ZKPs, which increase both transaction size and verification cost, though efficiency remains a design goal with lightweight proofs and future aggregation possibilities.
Q9. What happens if validators cannot verify a ZKP?
If validators cannot verify a ZKP, the transaction is rejected during consensus, functioning identically to an invalid signature and thus preventing malformed or incorrect confidential balances from entering the ledger.
Q10. Why does the issuer need a second account?
The issuer utilizes a second account as a designated holder account to convert their public reserve into the confidential supply. This approach is primarily used to keep the existing XLS-33 semantics intact, ensuring that the OutstandingAmount accurately reflects non-issuer balances.
Q11. Will proofs be optimized in future versions?
The current design employs separate range and equality proofs for each transaction. However, future work will definitely prioritize optimizing these proofs to significantly reduce both transaction size and the associated verification cost for validators. Thorough benchmarking will be essential to find the right balance between validator performance and overall user experience.
Q12. Can there be more than one auditor?
At present, the protocol supports only a single, optional AuditorPolicy. Future extensions could explore multi-auditor setups, potentially leveraging advanced cryptographic techniques such as threshold encryption or more sophisticated policy-driven key distribution mechanisms.
Q13. Is the system quantum-safe?
Today's design relies on EC-ElGamal over secp256k1, which is not considered quantum-safe. The long-term plan includes migrating to post-quantum friendly schemes, such as those based on lattice cryptography. The specific migration path and timeline for achieving quantum resistance remain an open area of research.
Q14. Why require explicit Merge instead of eliminating it in future?
The explicit MergeInbox transaction is currently required because it deterministically solves the issue of "staleness," ensuring that all received funds are consolidated before spending. While issuers and wallets might prefer less operational overhead, the current design offers clear, verifiable guarantees. Future designs may revisit whether the second-account model or other protocol refinements could simplify or even eliminate this explicit merge requirement.
Acknowledgements
We would like to thank David Schwartz, Ayo Akinyele, Kenny Lei, Shashwat Mittal, and Shawn Xie for their invaluable feedback and insightful discussions which improved this specification.
Beta Was this translation helpful? Give feedback.
All reactions