### Example SponsorshipSet JSON Source: https://opensource.ripple.com/docs/xls-68-sponsored-fees-and-reserves/references/transactions/sponsorshipset.md This is an example of a SponsorshipSet transaction in JSON format. It includes fields for the account, sponsee, fee amounts, reserve count, and sequence number. ```json { "TransactionType": "SponsorshipSet", "Account": "rN7n7otQDd6FczFgLdlqtyMVrn3HMfXpf", "Sponsee": "rfkDkFai4jUfCvAJiZ5Vm7XvvWjYvDqeYo", "FeeAmount": "1000000", "MaxFee": "1000", "ReserveCount": 5, "Fee": "12", "Sequence": 42 } ``` -------------------------------- ### ConfidentialMPTConvert JSON Example Source: https://opensource.ripple.com/docs/xls-96-confidential-transfers/references/transactions/confidentialmptconvert.md This is an example of the JSON structure for a ConfidentialMPTConvert transaction. It includes fields for account, token issuance, amounts, encryption keys, and proof. ```json { "TransactionType": "ConfidentialMPTConvert", "Account": "rBob...", "MPTokenIssuanceID": "610F33...", "MPTAmount": "1000", "HolderEncryptionKey": "038d...", "HolderEncryptedAmount": "AD3F...", "IssuerEncryptedAmount": "BC2E...", "BlindingFactor": "EE21...", "ZKProof": "ABCD...", "Fee": "12", "Sequence": 2470665, "Flags": 2147483648 } ``` -------------------------------- ### ConfidentialMPTClawback Transaction Example Source: https://opensource.ripple.com/docs/xls-96-confidential-transfers/references/transactions/confidentialmptclawback.md An example of a ConfidentialMPTClawback transaction in JSON format. ```APIDOC ## ConfidentialMPTClawback Transaction ### Description Claw back a holder's *entire* confidential balance (inbox and spending), removing it from circulation. Unlike a regular Clawback, confidential balances are encrypted, so the issuer must provide the plaintext total amount to claw back and a Zero-Knowledge Proof (ZKP) validating the amount. *(Requires the ConfidentialTransfers amendment)* ### Method POST ### Endpoint /transactions ### Request Body - **TransactionType** (string) - Required - Must be "ConfidentialMPTClawback". - **Account** (string) - Required - The account from which funds are being clawed back. - **Holder** (string) - Required - The account from which funds are being clawed back. - **MPTokenIssuanceID** (string) - Required - The unique identifier for the MPT issuance. - **MPTAmount** (string) - Required - The plaintext total amount being removed. - **ZKProof** (string) - Required - An Equality Proof validating the amount. - **Fee** (string) - Optional - The transaction fee. - **Sequence** (integer) - Optional - The transaction sequence number. - **Flags** (integer) - Optional - Transaction flags. ### Request Example ```json { "TransactionType": "ConfidentialMPTClawback", "Account": "rIssuerAccount...", "Holder": "rMaliciousHolder...", "MPTokenIssuanceID": "610F33B8EBF7EC795F822A454FB852156AEFE50BE0CB8326338A81CD74801864", "MPTAmount": "1000", "ZKProof": "a1b2...", "Fee": "12", "Sequence": 2470665, "Flags": 2147483648 } ``` ### Response #### Success Response (200) - **Account** (string) - The account that initiated the transaction. - **Fee** (string) - The transaction fee. - **Sequence** (integer) - The transaction sequence number. - **TxnSignature** (string) - The signature of the transaction. - **Flags** (integer) - Transaction flags. - **MPTokenIssuanceID** (string) - The unique identifier for the MPT issuance. - **MPTAmount** (string) - The plaintext total amount being removed. - **ZKProof** (string) - An Equality Proof validating the amount. - **Holder** (string) - The account from which funds are being clawed back. - **TransactionType** (string) - The type of transaction. - **Hash** (string) - The hash of the transaction. - **Date** (integer) - The date and time of the transaction. - **InLedger** (integer) - The ledger index where the transaction was included. - **LedgerSequence** (integer) - The sequence number of the ledger. #### Response Example ```json { "Account": "rIssuerAccount...", "Fee": "12", "Sequence": 2470665, "TxnSignature": "...", "Flags": 2147483648, "MPTokenIssuanceID": "610F33B8EBF7EC795F822A454FB852156AEFE50BE0CB8326338A81CD74801864", "MPTAmount": "1000", "ZKProof": "a1b2...", "Holder": "rMaliciousHolder...", "TransactionType": "ConfidentialMPTClawback", "Hash": "...", "Date": 1675000000, "InLedger": 1000000, "LedgerSequence": 1000000 } ``` ``` -------------------------------- ### ConfidentialMPTSend Transaction JSON Example Source: https://opensource.ripple.com/docs/xls-96-confidential-transfers/references/transactions/confidentialmptsend.md This JSON object demonstrates the structure of a ConfidentialMPTSend transaction. Ensure all required fields, including encrypted amounts and ZKProof, are correctly populated. ```json { "TransactionType": "ConfidentialMPTSend", "Account": "rSenderAccount...", "Destination": "rReceiverAccount...", "MPTokenIssuanceID": "610F33B8EBF7EC795F822A454FB852156AEFE50BE0CB8326338A81CD74801864", "SenderEncryptedAmount": "AD3F...", "DestinationEncryptedAmount": "DF4E...", "IssuerEncryptedAmount": "BC2E...", "ZKProof": "84af...", "AmountCommitment": "038A...", "BalanceCommitment": "02F1...", "Fee": "12", "Sequence": 2470665, "Flags": 2147483648 } ``` -------------------------------- ### Sponsorship Ledger Entry JSON Example Source: https://opensource.ripple.com/docs/xls-68-sponsored-fees-and-reserves/references/ledger-entries/sponsorship.md This JSON object represents a Sponsorship ledger entry. It includes details about the sponsor, sponsee, fee amounts, and reserve counts. ```json { "LedgerEntryType": "Sponsorship", "Flags": 0, "Owner": "rN7n7otQDd6FczFgLdlqtyMVrn3HMfXpf", "Sponsee": "rfkDkFai4jUfCvAJiZ5Vm7XvvWjYvDqeYo", "FeeAmount": "1000000", "MaxFee": "1000", "ReserveCount": 5, "OwnerNode": "0000000000000000", "SponseeNode": "0000000000000000", "PreviousTxnID": "1234567890ABCDEF1234567890ABCDEF1234567890ABCDEF1234567890ABCDEF", "PreviousTxnLgrSeq": 12345678 } ``` -------------------------------- ### SponsorshipTransfer Transaction JSON Example Source: https://opensource.ripple.com/docs/xls-68-sponsored-fees-and-reserves/references/transactions/sponsorshiptransfer.md This is a basic example of a SponsorshipTransfer transaction in JSON format. It includes essential fields like TransactionType, Account, ObjectID, Flags, Fee, and Sequence. ```json { "TransactionType": "SponsorshipTransfer", "Account": "rN7n7otQDd6FczFgLdlqtyMVrn3HMfXpf", "ObjectID": "1234567890ABCDEF1234567890ABCDEF1234567890ABCDEF1234567890ABCDEF", "Flags": 2, "Fee": "12", "Sequence": 43 } ``` -------------------------------- ### ConfidentialMPTConvertBack Transaction JSON Example Source: https://opensource.ripple.com/docs/xls-96-confidential-transfers/references/transactions/confidentialmptconvertback.md This JSON object represents a sample ConfidentialMPTConvertBack transaction. It includes fields for the transaction type, account, MPT token issuance ID, amounts, cryptographic proofs, and fee information. ```json { "TransactionType": "ConfidentialMPTConvertBack", "Account": "rUserAccount...", "MPTokenIssuanceID": "610F33...", "MPTAmount": "500", "HolderEncryptedAmount": "AD3F...", "IssuerEncryptedAmount": "BC2E...", "AuditorEncryptedAmount": "C1A9...", "BlindingFactor": "12AB...", "ZKProof": "ABCD...", "BalanceCommitment": "038A...", "Fee": "12", "Sequence": 2470665, "Flags": 2147483648 } ``` -------------------------------- ### ConfidentialMPTMergeInbox Transaction JSON Source: https://opensource.ripple.com/docs/xls-96-confidential-transfers/references/transactions/confidentialmptmergeinbox.md Example JSON structure for a ConfidentialMPTMergeInbox transaction. Ensure all required fields are present and correctly formatted. ```json { "TransactionType": "ConfidentialMPTMergeInbox", "Account": "rUserAccount...", "MPTokenIssuanceID": "610F33B8EBF7EC795F822A454FB852156AEFE50BE0CB8326338A81CD74801864", "Fee": "12", "Sequence": 2470665, "Flags": 2147483648 } ``` -------------------------------- ### AccountRoot Ledger Entry with Sponsor Field Source: https://opensource.ripple.com/docs/xls-68-sponsored-fees-and-reserves/references/ledger-entries/updated-ledger-entries.md This JSON object illustrates an AccountRoot ledger entry that includes the new 'Sponsor' field, indicating that the reserve for this object is paid by another account. It also shows related fields for tracking sponsored and sponsoring counts. ```json { "LedgerEntryType": "AccountRoot", "Account": "rfkDkFai4jUfCvAJiZ5Vm7XvvWjYvDqeYo", "Balance": "100000000", // 100 XRP in drops "OwnerCount": 5, "Sponsor": "rN7n7otQDd6FczFgLdlqtyMVrn3HMfXpf", "SponsoredOwnerCount": 2, "SponsoringOwnerCount": 1, "SponsoringAccountCount": 1, "PreviousTxnID": "1234567890ABCDEF1234567890ABCDEF1234567890ABCDEF1234567890ABCDEF", "PreviousTxnLgrSeq": 12345679 } ``` -------------------------------- ### Create MPTokenIssuance with Mutable Metadata Source: https://opensource.ripple.com/docs/xls-94-dynamic-mpts/reference.md Use this JSON to create an MPTokenIssuance object, specifying `MutableFlags` to indicate that the `MPTokenMetadata` field can be changed later. Ensure the DynamicMPT amendment is enabled. ```json { "TransactionType": "MPTokenIssuanceCreate", "Account": "rNFta7UKwcoiCpxEYbhH2v92numE3cceB6", "AssetScale": 4, "TransferFee": 0, "MaximumAmount": "50000000", "Flags": 83659, "MutableFlags": 65536, // tmfMPTCanMutateMetadata "MPTokenMetadata": "464F4F", "Fee": "12", "Flags": 122, "Sequence": 99536574 } ``` -------------------------------- ### Payment Transaction with tfSponsorCreatedAccount Flag Source: https://opensource.ripple.com/docs/xls-68-sponsored-fees-and-reserves/references/transactions/updated-transactions.md This JSON object demonstrates a Payment transaction configured to create a new sponsored account. The `tfSponsorCreatedAccount` flag must be enabled, and the `Amount` should be a non-XRP currency. ```json { "TransactionType": "Payment", "Account": "rN7n7otQDd6FczFgLdlqtyMVrn3HMfXpf", // The new sponsored account "Destination": "rfkDkFai4jUfCvAJiZ5Vm7XvvWjYvDqeYo", "Amount": "1", // 1 drop, the minimum "Flags": 524288, // tfSponsorCreatedAccount "Fee": "10", "Sequence": 3 } ``` -------------------------------- ### RippleState Ledger Entry with Sponsor Fields Source: https://opensource.ripple.com/docs/xls-68-sponsored-fees-and-reserves/references/ledger-entries/updated-ledger-entries.md This JSON object demonstrates a RippleState ledger entry that includes the 'HighSponsor' and 'LowSponsor' fields. These fields are used when a trust line's reserve is sponsored by one or two accounts, respectively. ```json { "LedgerEntryType": "RippleState", "Balance": { "currency": "USD", "issuer": "rLowAccountAddressXXXXXXXXXXXXXXX", "value": "-10" }, "HighLimit": { "currency": "USD", "issuer": "rHighAccountAddressXXXXXXXXXXXXXX", "value": "100" }, "LowLimit": { "currency": "USD", "issuer": "rLowAccountAddressXXXXXXXXXXXXXXX", "value": "0" }, "HighSponsor": "rN7n7otQDd6FczFgLdlqtyMVrn3HMfXpf", "LowSponsor": "rN7n7otQDd6FczFgLdlqtyMVrn3HMfXpf", "Flags": 262144, "HighNode": "0000000000000000", "LowNode": "0000000000000000", "PreviousTxnID": "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789", "PreviousTxnLgrSeq": 12345680 } ``` -------------------------------- ### MPTokenIssuanceCreate Flags for Confidential Transfers Source: https://opensource.ripple.com/docs/xls-96-confidential-transfers/references/transactions/updated-transactions.md This section details the flags specific to MPTokenIssuanceCreate that enable confidential transfer capabilities for MPT issuances. ```APIDOC ## MPTokenIssuanceCreate Flags Confidential `MPTokenIssuanceCreate` transactions support the following flag: | Flag Name | Hex Value | Decimal Value | Description | |---|---|---|---| | `tfMPTCanConfidentialAmount` | `0x00000080` | 128 | If enabled, the MPT issuance supports confidential transfers. | Confidential MPTokenIssuanceCreate transactions also support the following value in the `MutableFlags` field: | Flag Name | Hex Value | Decimal Value | Description | |---|---|---|---| | `tmfMPTCannotMutateCanConfidentialAmount` | `0x00040000` | 262144 | If enabled, issuers cannot change the **Can Confidential Amount** flag after the token is issued. | ``` -------------------------------- ### ConfidentialMPTConvertBack Transaction Structure Source: https://opensource.ripple.com/docs/xls-96-confidential-transfers/references/transactions/confidentialmptconvertback.md This snippet shows the structure of a ConfidentialMPTConvertBack transaction, including all required and optional fields. ```APIDOC ## ConfidentialMPTConvertBack Transaction ### Description Converts a confidential MPT balance back to a public balance. This debits the confidential spending balance and credits the public balance with the plaintext amount. For the issuer's second account, this returns confidential supply to the issuer account reserve. ### Method POST ### Endpoint / (XRPL Ledger API) ### Parameters #### Common Fields - **TransactionType** (string) - Required - Must be "ConfidentialMPTConvertBack". - **Account** (string) - Required - The account submitting the transaction. - **Fee** (string) - Required - The amount of XRP to pay as a transaction fee. - **Sequence** (number) - Required - The sequence number of the transaction. - **Flags** (number) - Optional - Transaction flags. #### Transaction Specific Fields - **MPTokenIssuanceID** (string) - Required - The unique identifier for the MPT issuance. - **MPTAmount** (string) - Required - The plaintext amount to credit to the public balance. - **HolderEncryptedAmount** (string) - Required - 66-byte Ciphertext to be subtracted from the holder's `sfConfidentialBalanceSpending`. - **IssuerEncryptedAmount** (string) - Required - 66-byte Ciphertext to be subtracted from the issuer's mirror balance. - **AuditorEncryptedAmount** (string) - Optional - 66-byte Ciphertext for the auditor. Required if `sfAuditorEncryptionKey` is present on the issuance. - **BlindingFactor** (string) - Required - The 32-byte scalar value used to encrypt the amount. - **ZKProof** (string) - Required - A bundle containing the Pedersen Linkage Proof and the Range Proof. - **BalanceCommitment** (string) - Required - A 33-byte cryptographic commitment to the user's confidential spending balance. ### Request Example ```json { "TransactionType": "ConfidentialMPTConvertBack", "Account": "rUserAccount...", "MPTokenIssuanceID": "610F33...", "MPTAmount": "500", "HolderEncryptedAmount": "AD3F...", "IssuerEncryptedAmount": "BC2E...", "AuditorEncryptedAmount": "C1A9...", "BlindingFactor": "12AB...", "ZKProof": "ABCD...", "BalanceCommitment": "038A...", "Fee": "12", "Sequence": 2470665, "Flags": 2147483648 } ``` ### Response #### Success Response (200) - **tx_json** (object) - The transaction in JSON format. - **tx_blob** (string) - The transaction in binary format. #### Response Example ```json { "tx_json": { "Account": "rUserAccount...", "BalanceCommitment": "038A...", "BlindingFactor": "12AB...", "Fee": "12", "Flags": 2147483648, "HolderEncryptedAmount": "AD3F...", "IssuerEncryptedAmount": "BC2E...", "MPTokenIssuanceID": "610F33...", "MPTAmount": "500", "Sequence": 2470665, "TransactionType": "ConfidentialMPTConvertBack", "ZKProof": "ABCD...", "hash": "...", "inLedger": 1234567, "ledger_index": 1234567 }, "tx_blob": "..." } ``` ``` -------------------------------- ### ConfidentialMPTConvert Transaction Source: https://opensource.ripple.com/docs/xls-96-confidential-transfers/references/transactions/confidentialmptconvert.md This transaction converts a public MPT balance to an encrypted confidential balance, which is credited to the holder's confidential inbox. It also enables confidential transfer participation by recording the HolderEncryptionKey. ```APIDOC ## ConfidentialMPTConvert Transaction ### Description Converts a public MPT balance to an encrypted confidential balance, which is credited to the holder's confidential inbox. This transaction also serves as the opt-in mechanism for confidential transfer participation. ### Transaction Type ConfidentialMPTConvert ### Fields - **Account** (String) - The account submitting the transaction. - **MPTokenIssuanceID** (String) - Required - The unique identifier for the MPT issuance being converted. - **MPTAmount** (String) - Required - The public plaintext amount to convert. Must be non-negative. - **HolderEncryptionKey** (String) - Optional - The holder's ElGamal public key. Required when enabling confidential transfers for the first time. Forbidden if a key is already registered. - **HolderEncryptedAmount** (String) - Required - 66-byte ElGamal ciphertext credited to the holder's inbox balance. - **IssuerEncryptedAmount** (String) - Required - 66-byte ElGamal ciphertext credited to the issuer's mirror balance. - **AuditorEncryptedAmount** (String) - Optional - A 66-byte ElGamal Ciphertext for the auditor. Required if `sfAuditorEncryptionKey` is present on the issuance. - **BlindingFactor** (String) - Required - The 32-byte scalar value used to encrypt the amount. - **ZKProof** (String) - Optional - A Schnorr Proof of Knowledge. Required only when `HolderEncryptionKey` is present. - **Fee** (String) - The transaction fee. - **Sequence** (Number) - The sequence number of the transaction. - **Flags** (Number) - Transaction flags. ### Request Example ```json { "TransactionType": "ConfidentialMPTConvert", "Account": "rBob...", "MPTokenIssuanceID": "610F33...", "MPTAmount": "1000", "HolderEncryptionKey": "038d...", "HolderEncryptedAmount": "AD3F...", "IssuerEncryptedAmount": "BC2E...", "BlindingFactor": "EE21...", "ZKProof": "ABCD...", "Fee": "12", "Sequence": 2470665, "Flags": 2147483648 } ``` ### Error Cases - **temDISABLED**: The ConfidentialTransfers amendment is not enabled. - **temMALFORMED**: The transaction is malformed (e.g., missing ZKProof when HolderEncryptionKey is present, incorrect key/factor/proof lengths). - **temBAD_AMOUNT**: The `MPTAmount` is negative or exceeds the maximum allowable amount. - **temBAD_CIPHERTEXT**: Encrypted amount fields have incorrect length or invalid elliptic curve points. - **tecNO_PERMISSION**: `sfAuditorEncryptionKey` is set, but `sfAuditorEncryptedAmount` is missing. - **tecDUPLICATE**: A public key is provided, but the account already has a registered key. - **tecINSUFFICIENT_FUNDS**: The holder lacks sufficient public MPT balance. - **tecBAD_PROOF**: The ZKP verification failed. ``` -------------------------------- ### AccountDelete Transaction for Sponsored Account Source: https://opensource.ripple.com/docs/xls-68-sponsored-fees-and-reserves/references/transactions/updated-transactions.md This JSON object shows an AccountDelete transaction where the `Destination` is the sponsor of the account being deleted. This is required to ensure the sponsor can recoup their reserve. ```json { "TransactionType": "AccountDelete", "Account": "rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm", "Destination": "rN7n7otQDd6FczFgLdlqtyMVrn3HMfXpf", // The sponsor "Fee": "5000000", "Sequence": 2470665 } ``` -------------------------------- ### Update MPToken Issuance Metadata Source: https://opensource.ripple.com/docs/xls-94-dynamic-mpts/reference.md This JSON demonstrates how to update the metadata of an existing MPTokenIssuance using the `MPTokenIssuanceSet` transaction. The `MPTokenIssuanceID` must correspond to an issuance where metadata mutability was enabled during creation. ```json { "TransactionType": "MPTokenIssuanceSet", "Account": "rNFta7UKwcoiCpxEYbhH2v92numE3cceB6", "MPTokenIssuanceID": "05EECEBE97A7D635DE2393068691A015FED5A89AD203F5AA", "MPTokenMetadata": "575C5C", // Updated metadata from `464F4F` to `575C5C` "Fee": "10", "Flags": 1, "Sequence": 99536577 } ``` -------------------------------- ### Standard Reserve Calculation Source: https://opensource.ripple.com/docs/xls-68-sponsored-fees-and-reserves/concepts/sponsored-fees-and-reserves.md This is the standard reserve calculation formula used when sponsorship is not involved. ```text acctReserve + objReserve × acct.OwnerCount ```