Skip to content

ConfidentialMPTConvertBack

[Source]

Convert your 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.

Note

Only the spending balance can be converted back. Amounts in the inbox must first be merged into the spending balance using [ConfidentialMPTMergeInbox][].

(Requires the ConfidentialTransfers amendment )

Example ConfidentialMPTConvertBack 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
}

ConfidentialMPTConvertBack Fields

In addition to the common fields, ConfidentialMPTConvertBack transactions use the following fields:

FieldJSON TypeInternal TypeRequired?Description
MPTokenIssuanceIDStringUInt192YesThe unique identifier for the MPT issuance.
MPTAmountStringUInt64YesThe plaintext amount to credit to the public balance.
HolderEncryptedAmountStringBlobYes66-byte Ciphertext to be subtracted from the holder's sfConfidentialBalanceSpending.
IssuerEncryptedAmountStringBlobYes66-byte Ciphertext to be subtracted from the issuer's mirror balance.
AuditorEncryptedAmountStringBlobNo66-byte Ciphertext for the auditor. Required if sfAuditorEncryptionKey is present on the issuance.
BlindingFactorStringUInt256YesThe 32-byte scalar value used to encrypt the amount. Used by validators to verify the ciphertexts match the plaintext MPTAmount.
ZKProofStringBlobYesA bundle containing the Pedersen Linkage Proof (linking the ElGamal balance to the commitment) and the Range Proof.
BalanceCommitmentStringBlobYesA 33-byte cryptographic commitment to the user's confidential spending balance.

Error Cases

Besides errors that can occur for all transactions, ConfidentialMPTConvertBack transactions can result in the following transaction result codes:

Error CodeDescription
temDISABLEDThe ConfidentialTransfer is not enabled.
temMALFORMEDThe account is the Issuer, or the BlindingFactor is not exactly 32 bytes.
temBAD_CIPHERTEXTCiphertext lengths or formats are invalid.
temBAD_AMOUNTMPTAmount is zero or greater than the maximum allowable supply.
tecOBJECT_NOT_FOUNDThe MPToken or MPTokenIssuance does not exist.
tecNO_PERMISSIONOne of the following occurred:
  • The issuance does not have the Can Confidential Amount flag.
  • The user's MPToken is missing the ConfidentialBalanceSpending or HolderEncryptionKey fields.
  • The issuance has AuditorEncryptionKey set but the transaction does not include AuditorEncryptedAmount.
tecINSUFFICIENT_FUNDSThe global sfConfidentialOutstandingAmount is less than the requested MPTAmount, or the user's confidential balance is insufficient.
tecBAD_PROOFOne of the following occurred:
  • The BlindingFactor fails to verify the integrity of the ciphertexts.
  • The ZKProof fails the Pedersen Linkage check (proving the commitment matches the on-ledger balance).
  • The ZKProof fails the Range Proof (proving the remaining balance is non-negative).
tecLOCKEDThe MPT asset is locked for the account, or the asset is globally locked.