Pular para o conteúdo

Create an MPT issuance

Create a new Multi-Purpose Token (MPT) issuance on the XRP Ledger.

Prerequisites

  • An XRPL account registered in Ripple Custody (Vault)
  • Sufficient XRP for reserves (owner reserve + issuance reserve)

Create an MPT issuance in the UI

To create an MPT:

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

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

  3. In Ledger, select the XRP Ledger network. Source account is set to the current account.

  4. In Operation, select Create token.

  5. Under Token details, enter the token's XLS-89 metadata:

    The token details section of the Create token form
    FieldDescriptionRequired
    Issuer nameThe name of the entity that issues the token.Yes
    NameThe token's display name.Yes
    SymbolThe token's ticker.Yes
    Asset classThe token's primary purpose: Defi, Gaming, Memes, Real-world asset, Wrapped, or Other.Yes
    Asset subclassThe type of real-world asset: Commodity, Equity, Private credit, Real estate, Stablecoin, Treasury, or Other. Shown only when Asset class is Real-world asset.Conditional
    IconThe URI of the token icon. Enter a hostname and path (HTTPS is assumed) or a full URI for other protocols.Yes
    DescriptionA long description of the token.No
  6. Set the supply and the flags:

    The asset scale, supply cap, and flags in the Create token form
    FieldDescription
    Decimals (asset scale)The number of decimal places, from 0 to 20. For example, 2 gives a precision of 0.01. If you leave it empty, the token can't be divided below 1 unit.
    Supply capThe maximum number of whole tokens in circulation. The cap applies before the asset scale, so a cap of 100 with 2 decimals allows 100.00 tokens. Leave it empty for no cap.
    Can transferHolders can transfer the token to each other. When you turn this on, the Transfer fee field appears.
    Transfer feeThe percentage fee, from 0 to 50%, that holders pay when they transfer the token to each other. It doesn't apply to transfers to the issuer.
    Can tradeThe token can be traded on the DEX.
    Can escrowThe token can be placed in escrow.
    Can lockYou can freeze one or all holders.
    Can clawbackYou can claw back tokens from holders.
    Require authorizationHolders need your authorization before they can hold the token.
  7. Optional: Under URIs, click Add URI to link resources such as a website or documentation. For each URI, enter a Title, a Category (Docs, Social, Website, or Other), and the full HTTPS or IPFS URI. You can't update URIs after the token is created.

  8. Optional: Under Additional information, click Add additional information to add label and value pairs such as an interest rate or maturity date.

    The URIs and additional information sections of the Create token form
  9. Select a Fee Strategy, and optionally set a maximum fee or add a description.

  10. Click Submit for approval and sign the operation with the app. The signing window shows the operation as MPT Issuance Create with the metadata and flags you entered.

    The signing window for a Create token operation

You can't change the flags or the metadata after the token is created. Check them in the signing window before you sign.

When the intent is approved, Ripple Custody (Vault) submits the transaction. To follow it, go to Transactions, open the transaction, and check that Custody Status is Completed and Ledger Status is Confirmed. ID on ledger is the transaction hash.

The transaction details for a confirmed MPT Issuance Create transaction

The ledger assigns the issuance ID when the transaction is confirmed. You need this ID to perform other operations on the token until the token is registered in Ripple Custody (Vault). To find it, look up the transaction by its ID on ledger in an XRPL explorer and read mpt_issuance_id from the transaction metadata.

Create an MPT issuance with the API

The SDK examples assume a configured client. See Integrate via SDK.

To create an MPT, submit a transaction order with the MPTokenIssuanceCreate operation:

{
  "payload": {
    "id": "{{intent_id}}",
    "accountId": "{{issuer_account_id}}",
    "ledgerId": "xrpl-testnet",
    "parameters": {
      "type": "XRPL",
      "feeStrategy": {
        "priority": "High",
        "type": "Priority"
      },
      "maximumFee": "1000000000",
      "memos": [],
      "operation": {
        "type": "MPTokenIssuanceCreate",
        "assetScale": 6,
        "transferFee": 0,
        "maximumAmount": "1000000000000000",
        "metadata": {
          "type": "HexEncodedMetadata",
          "value": "7B226E223A224D7920546F6B656E222C2264223A22546F6B656E206465736372697074696F6E227D"
        },
        "flags": ["tfMPTCanTransfer", "tfMPTCanTrade", "tfMPTCanClawback", "tfMPTCanLock"]
      }
    },
    "description": "MPTokenIssuanceCreate intent",
    "customProperties": {},
    "type": "v0_CreateTransactionOrder"
  }
}

For a complete program, see the XRPL MPT example: 48 in TypeScript, 49 in Python, or 51 in Java. To get the examples, see Examples.

In the SDKs, you pass metadata as the hex string only, and the SDK wraps it in the HexEncodedMetadata object.

The metadata.value field contains hex-encoded JSON. The example above decodes to: {"n":"My Token","d":"Token description"}. Use a hex encoding utility to convert your metadata JSON to hex format.

Parameters

FieldTypeRequiredDescription
flagsarrayYesIssuance flags. Can be empty []. See Issuance flags.
assetScaleintegerNoDecimal precision (0-255). Default: 0
maximumAmountstringNoMaximum supply in raw units, before assetScale is applied (64-bit unsigned integer as string). Omit for unlimited.
transferFeeintegerNoTransfer fee in units of 0.001%, from 0 to 50000 (50%). For example, 500 is a 0.5% fee. Requires the tfMPTCanTransfer flag.
metadataobjectNoHex-encoded on-chain metadata. See Metadata format.

Metadata format

The metadata field must be an object with the following structure:

FieldTypeRequiredDescription
typestringYesMust be HexEncodedMetadata.
valuestringYesHex-encoded metadata string.

Issuance flags

Set these flags during creation to control token behavior. These flags are immutable after creation.

FlagDescription
tfMPTCanLockIssuer can freeze tokens.
tfMPTRequireAuthHolders must be authorized before receiving tokens.
tfMPTCanTransferHolders can transfer tokens to each other.
tfMPTCanClawbackIssuer can reclaim tokens from holders.
tfMPTCanEscrowTokens can be placed in escrow.
tfMPTCanTradeTokens can be traded on the DEX.

Choose flags carefully during issuance. Most flags cannot be changed after the MPT is created.

Response

A successful request returns the transaction order with status Pending. The transaction includes the generated MPTIssuanceID in the on-chain result after confirmation.

Retrieve the issuance ID

After the transaction is confirmed, retrieve the issuance ID from the transaction result:

  1. Query the transaction order by ID.
  2. Extract the MPTIssuanceID from the ledger result.

The SDKs read the ID for you. Pass the result of waiting for the transaction hash to extractMptIssuanceId (TypeScript), Transactions.extractMptIssuanceId (Java), or extract_mpt_issuance_id (Python), as shown in Create an MPT issuance with the API.

The issuance ID is a 192-bit identifier (48 hex characters) used to reference the MPT in all subsequent operations.