Pular para o conteúdo

Authorize MPTs

Before receiving an MPT for the first time, the holder must submit an MPTokenAuthorize transaction. This creates an MPToken entry with an initial zero balance.

Prerequisites

PrerequisiteAdditional information
An XRPL account in Ripple Custody (Vault)View account details
The MPT Issuance ID (48 hex characters)Provided by the token issuer
Sufficient XRP for reservesOwner reserve + MPToken object reserve

Authorize an MPT in the UI

To opt in to an MPT:

  1. Go to Accounts and open the account that will hold the token.

  2. Click Create order and select Ledger-specific operations.

  3. In Ledger, select the XRP Ledger network.

  4. In Operation, select Opt in to token.

  5. Select the token:

    • Listed asset — Select the token from the list of registered assets.
    • Unlisted asset — Enter the issuance ID that the issuer gave you. A new MPT usually isn't in the list until your account has received it.
    The Opt in to token form with an unlisted MPT
  6. Select a Fee Strategy, then click Submit for approval and sign the operation with the app. The signing window shows the operation as MPT Authorize with the setting Holder opt-in.

    The signing window for an Opt in to token operation

If the MPT requires authorization, the issuer must also authorize your account before you can receive the token.

Authorize an MPT with the API

System change process

All new requests to change the system state follow the same process. To familiarize yourself with this process first, see Manage intents and approvals.

To authorize an MPT in Ripple Custody (Vault), create a transaction order with the MPTokenAuthorize operation:

Payload example

{
  "payload": {
    "id": "{{intent_id}}",
    "accountId": "42e44ded-a268-4426-a0fe-7287b5d52a01",
    "ledgerId": "xrpl-testnet",
    "parameters": {
      "type": "XRPL",
      "feeStrategy": {
        "priority": "Medium",
        "type": "Priority"
      },
      "memos": [],
      "operation": {
        "type": "MPTokenAuthorize",
        "tokenIdentifier": {
          "issuanceId": "000004C463C52827307480341125DA0577AFFC21D4B2D083",
          "type": "MPTokenIssuanceId"
        },
        "flags": []
      }
    },
    "customProperties": {},
    "type": "v0_CreateTransactionOrder"
  }
}

Payload fields

FieldTypeDescription
operation.typestringMust be MPTokenAuthorize.
operation.tokenIdentifier.typestringMPTokenIssuanceId to identify the MPT by its issuance ID, or TickerId to identify it by its ticker ID.
operation.tokenIdentifier.issuanceIdstringThe 192-bit MPT issuance ID (48 hex characters). Required when type is MPTokenIssuanceId.
operation.tokenIdentifier.tickerIdstringThe ID of the MPT's ticker. Required when type is TickerId.
operation.flagsarrayEmpty array [] for authorization.

Revoke authorization with the API

To revoke authorization and remove the MPToken entry, include the tfMPTUnauthorize flag:

{
  "operation": {
    "type": "MPTokenAuthorize",
    "tokenIdentifier": {
      "issuanceId": "000004C463C52827307480341125DA0577AFFC21D4B2D083",
      "type": "MPTokenIssuanceId"
    },
    "flags": ["tfMPTUnauthorize"]
  }
}

You can only revoke authorization if your MPT balance is zero. Transfer or return all tokens before revoking.