MPToken

Attention

Multi-purpose Token functionality is part of the proposed XLS-33d extension to the XRP Ledger protocol. You can use these functions on test networks for now. Until there is an amendment in a stable release, the details documented on these pages are subject to change.

The MPToken object represents a number of tokens held by an account that is not the token issuer. MPTs are acquired via ordinary payment or DEX transactions, and can optionally be redeemed or exchanged using these same types of transactions. The object key of the MPToken is derived from hashing the space key, the holder's address, and the MPTokenIssuanceID.

Example MPToken JSON

{
    "LedgerEntryType": "MPToken",
    "Account": "rajgkBmMxmz161r8bWYH7CQAFZP5bA9oSG",
    "MPTokenIssuanceID": "000004C463C52827307480341125DA0577DEFC38405B0E3E",
    "Flags": 0,
    "MPTAmount": "100000000",
    "OwnerNode": 1
}

MPTokenID

The MPTokenID is the result of SHA512-Half of the following values, concatenated in order:

  • The MPToken space key (0x0074).
  • The MPTokenIssuanceID for the issuance being held.
  • The AccountID of the token holder.

MPToken Fields

MPToken objects have the following fields.

Field NameJSON TypeInternal TypeDescription
LedgerEntryTypenumberUInt16The value 0x007F, mapped to the string MPToken, indicates that this object describes an individual account's holding of an MPT.
AccountstringAccountIDThe owner of the MPT.
MPTokenIssuanceIDstringUInt256The MPTokenIssuance identifier.
MPTAmountstringUInt64This value specifies a positive amount of tokens currently held by the owner. Valid values for this field are between 0x0 and 0xFFFFFFFFFFFFFFFF.
FlagsnumberUInt32(Default) See MPToken Flags
PreviousTxnIDstringHash256Transaction ID of the transaction that most recently modified this object.
PreviousTxnLgrSeqnumberUInt32The sequence of the ledger that contains the transaction that most recently modified this object.
OwnerNodenumberUInt64(Default) The page in the owner's directory where this item is referenced.

MPToken Flags

Flags are properties or other options associated with the MPToken object.

Flag NameFlag ValueDescription
lsfMPTLocked0x0001If enabled, indicates that the MPT owned by this account is currently locked and cannot be used in any XRP transactions other than sending value back to the issuer. When this flag is set, the LockedAmount must equal the MPTAmount value.
lsfMPTAuthorized0x0002(Only applicable for allow-listing) If set, indicates that the issuer has authorized the holder for the MPT. This flag can be set using a MPTokenAuthorize transaction; it can also be "un-set" using a MPTokenAuthorize transaction specifying the tfMPTUnauthorize flag.