# ConfidentialMPTConvert [[Source]](https://github.com/XRPLF/rippled/blob/eeb0d15ea97ed506c65406635edf301eff62a6fd/src/libxrpl/tx/transactors/token/ConfidentialMPTConvert.cpp) Convert your public MPT balance to an encrypted confidential balance. The converted amount is credited to your confidential inbox balance, requiring an explicit [ConfidentialMPTMergeInbox transaction](/docs/xls-96-confidential-transfers/references/transactions/confidentialmptmergeinbox) to merge it into your spending balance before use. This transaction also serves as the opt-in mechanism for confidential transfer participation. By executing it, including with a zero-amount conversion, your `HolderEncryptionKey` is recorded on your `MPToken` object, enabling you to receive and manage confidential funds. Issuers can convert tokens through a separate holder account that they control, which participates as a regular holder with no special privileges. Note This transaction converts only your **own** balance. To send confidential tokens to another account, first convert your balance, then use [ConfidentialMPTSend transaction](/docs/xls-96-confidential-transfers/references/transactions/confidentialmptsend). *(Requires the [ConfidentialTransfers amendment](https://xls.xrpl.org/xls/XLS-0096-confidential-mpt.html) )* ## Example JSON ```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 } ``` ## Fields In addition to the [common fields](https://xrpl.org/docs/references/protocol/transactions/common-fields#transaction-common-fields), transactions use the following fields: | Field | JSON Type | [Internal Type](https://xrpl.org/docs/references/protocol/binary-format/) | Required? | Description | | --- | --- | --- | --- | --- | | `MPTokenIssuanceID` | String | UInt192 | Yes | The unique identifier for the MPT issuance being converted. | | `MPTAmount` | String | UInt64 | Yes | The public plaintext amount to convert into a confidential balance. Must be non-negative. | | `HolderEncryptionKey` | String | Blob | No | The holder's ElGamal public key for confidential balances. Required when enabling confidential transfers for the first time. Forbidden if a key is already registered. | | `HolderEncryptedAmount` | String | Blob | Yes | 66-byte ElGamal ciphertext credited to the holder's inbox balance. | | `IssuerEncryptedAmount` | String | Blob | Yes | 66-byte ElGamal ciphertext credited to the issuer's mirror balance. | | `AuditorEncryptedAmount` | String | Blob | No | A 66-byte ElGamal Ciphertext for the auditor. Required if `sfAuditorEncryptionKey` is present on the issuance. | | `BlindingFactor` | String | UInt256 | Yes | The 32-byte scalar value used to encrypt the amount. Used by validators to verify the ciphertexts match the plaintext `MPTAmount`. | | `ZKProof` | String | Blob | No | A Schnorr Proof of Knowledge. Required only when `HolderEncryptionKey` is present. | ## Error Cases Besides errors that can occur for all transactions, transactions can result in the following [transaction result codes](https://xrpl.org/docs/references/protocol/transactions/transaction-results): | Error Code | Description | | --- | --- | | `temDISABLED` | The ConfidentialTransfers amendment is not enabled. | | `temMALFORMED` | The transaction is malformed for one of the following reasons:`HolderEncryptionKey` is provided but `ZKProof` is not.`HolderEncryptionKey` is not provided but `ZKProof` is.`HolderEncryptionKey` length is not exactly 64 bytes.`BlindingFactor` length is not 32 bytes.`ZKProof` length is not 65 bytes. | | `temBAD_AMOUNT` | The `MPTAmount` is less than 0 or exceeds the maximum allowable MPT amount. | | `temBAD_CIPHERTEXT` | One or more encrypted amount fields (`HolderEncryptedAmount`, `IssuerEncryptedAmount`, or `AuditorEncryptedAmount`) have incorrect length or represent an invalid elliptic curve point. | | `tecNO_PERMISSION` | The issuance has `sfAuditorEncryptionKey` set, but the transaction does not include `sfAuditorEncryptedAmount`. | | `tecDUPLICATE` | A public key is provided in the transaction, but the account already has a registered key. | | `tecINSUFFICIENT_FUNDS` | The holder does not have sufficient public MPT balance to cover the MPTAmount. | | `tecBAD_PROOF` | The ZKP verification failed for one of the following reasons:The `BlindingFactor` fails to reconstruct the provided ciphertexts given the plaintext `MPTAmount`.The Schnorr ZKP fails to verify the holder's knowledge of the secret key. |