-
Notifications
You must be signed in to change notification settings - Fork 1.5k
MPT (MPTokens) FAQ
Elliot Lee edited this page Feb 27, 2025
·
2 revisions
MPTokens will be an improved token mechanism on the ledger.
-
Specification Reference:
The detailed specification is available here: https://github.com/XRPLF/XRPL-Standards/tree/master/XLS-0033d-multi-purpose-tokens#readme-
Key Components:
-
MPTokenIssuance:
Tracks the overall token (e.g., a USD stablecoin) and defines its properties, including regulatory features and metadata. -
MPToken:
Represents each individual user’s holding of the token.
-
MPTokenIssuance:
-
Key Components:
-
Direct Payment Support:
Enables straightforward on-ledger payments. -
Regulatory Controls:
Certain flags on the issuance object enable regulatory features:-
Authorization Required: (
lsfMPTRequireAuth
) -
Clawback Capability: (
lsfMPTCanClawback
) -
Freeze/Lock Capability: (
lsfMPTCanLock
)
-
Authorization Required: (
-
DEX (Decentralized Exchange) Support:
Enables trading directly on the ledger. -
Escrow Functionality:
Supports conditional transactions.
-
63-Bit Amount Field:
- Maximum value:
0x7FFFFFFFFFFFFFFF
- Note: The on-chain amount itself is not divisible.
- Maximum value:
-
AssetScale:
- A separate
Uint8
field (maximum value 255) provided for off-chain interpretation. - Allows issuers to define how the basic unit should be interpreted (e.g., for decimal places).
- A separate
-
Storage Limit:
- Up to 1024 bytes can be stored in the metadata field.
-
Usage:
- Designed to store on-chain descriptive data about the token (such as icons, terms, or other metadata).
- Not used for storing code; current ledger implementations do not support smart contracts.
-
Mutability:
- Current Behavior: Metadata is immutable once set.
- Future Considerations: There is discussion about enabling metadata mutability via transactions.
-
Important Note:
- If the metadata includes a URL, the data behind that URL can change even though the URL itself is immutable.
-
Encoding Guidelines:
- The metadata is stored as a binary blob.
- You may encode your metadata as a minified JSON string or as a Data-URI (e.g.,
data:application/json;base64,...
) provided it is ultimately converted to a HEX-encoded string. - Ledger implementations (e.g., current versions of rippled) do not decode this field; consistency in encoding/decoding is left to developers.
- A proposal and discussion on serialization methods is available in the standards discussions.
-
Simplified Balance Tracking:
- MPTokens track only one balance per token.
- They eliminate debt relationships, trust limits, and rippling behavior inherent in IOU tokens.
-
Mathematical Simplicity:
- Use of integer math (no floating point) simplifies development and reduces complexity.
-
On-Ledger Footprint & Performance:
- MPTokens are designed to be significantly smaller on-ledger (up to 5× smaller for some tokens).
- They exhibit performance characteristics that approximate native XRP payments, with higher throughput demonstrated in performance testing.
-
Token Metadata Storage:
- Provide an authoritative source for token details such as icons, descriptions, terms, or other data.
-
Fractional Ownership:
- Ideal for fractionalizing assets (e.g., real-world assets like property or vehicles).
-
Example:
- An asset (such as a car or a $1B private equity fund) can be issued as an MPT with a defined maximum number of units (e.g., 10,000 units), allowing multiple parties to hold fractional interests.
Q1: What differentiates MPTokens from traditional XRP IOU tokens?
- A: MPTokens feature a simpler balance model without trustlines or debt relationships, use integer math (avoiding floating point issues), and include on-chain metadata. They also have a smaller on-ledger footprint and improved performance characteristics.
Q2: How divisible are MPTokens on-chain?
-
A: The token amount is stored in a 63-bit field (max
0x7FFFFFFFFFFFFFFF
) and is not divisible on-chain. However, the issuer can define anAssetScale
(Uint8, up to 255) off-chain to represent decimal precision.
Q3: Can the metadata associated with an MPT be changed?
- A: Currently, the on-chain metadata is immutable. In future versions, there may be support for metadata mutability via transactions. Note that while the metadata blob itself is immutable, if it contains a URL, the content at that URL may change.
Q4: What is the size limit for on-chain metadata and how can it be encoded?
- A: The metadata is limited to 1024 bytes. Developers can store any arbitrary data in this blob, such as a minified JSON string or a Data-URI (after converting to HEX). It is essential that the encoding method remains consistent between storage and decoding.
Q5: What are the planned enhancements for future versions of MPTokens?
- A: Future iterations (MPT V2) are expected to introduce support for decentralized exchange (DEX) functionalities and escrow capabilities.