Add MPTs to basic data types and currency formats

This commit is contained in:
Dennis Dawson
2025-02-21 15:04:48 -08:00
parent 232860eaf5
commit 739e769c6b
2 changed files with 38 additions and 14 deletions

View File

@@ -129,6 +129,12 @@ XRP is specified as a string containing an integer number of "drops" of XRP, whe
"issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"
}
```
- **MPT** - Use `MPTAmount` to specify the value of an MPT. To specify a value of 13.1 units of an MPT:
```
"MPTAmount": 13.1
```
For more information, see [Currency Formats](currency-formats.md).

View File

@@ -6,29 +6,32 @@ seo:
label:
- XRP
- Tokens
- MPTs
---
# Currency Formats
The XRP Ledger has two kinds of digital asset: XRP and [tokens](../../../concepts/tokens/index.md). Both types have high precision, although their formats are different.
The XRP Ledger has three kinds of digital asset: XRP, [tokens](../../../concepts/tokens/index.md), and [Multi-purpose Tokens (MPTs)](../../../concepts/tokens/fungible-tokens/multi-purpose-tokens.md). All three types have high precision, although their formats are different.
_(Requires the [MPToken amendment][] {% not-enabled /%})_
## Comparison
The following table summarizes some of the differences between XRP and tokens in the XRP Ledger:
The following table summarizes some of the differences XRP, tokens, and MPTs in the XRP Ledger:
| XRP | Tokens |
|:---------------------------------------------------------|:------------------|
| Has no issuer. | Always issued by an XRP Ledger account. |
| Specified as a string. | Specified as an object. |
| Tracked in [accounts](../ledger-data/ledger-entry-types/accountroot.md). | Tracked in [trust lines](../ledger-data/ledger-entry-types/ripplestate.md). |
| Can never be created; can only be destroyed. | Can be issued or redeemed freely. |
| Minimum value: `0`. (Cannot be negative.) | Minimum value: `-9999999999999999e80`. Minimum nonzero absolute value: `1000000000000000e-96`.
| Maximum value `100000000000` (10<sup>11</sup>) XRP. That's `100000000000000000` (10<sup>17</sup>) "drops". | Maximum value `9999999999999999e80`. |
| XRP | Tokens | MPTs |
|:---------------------------------------------------------|:------------------|:---------------------|
| Has no issuer. | Always issued by an XRP Ledger account. | Always issued by an XRP Ledger account. |
| Specified as a string. | Specified as an object. | Specified as an object. |
| Tracked in [accounts](../ledger-data/ledger-entry-types/accountroot.md). | Tracked in [trust lines](../ledger-data/ledger-entry-types/ripplestate.md). | Tracked in holder's account. |
| Can never be created; can only be destroyed. | Can be issued or redeemed freely. | Can be issued or redeemed freely. |
| Minimum value: `0`. (Cannot be negative.) | Minimum value: `-9999999999999999e80`. Minimum nonzero absolute value: `1000000000000000e-96`. | Minimum value: `0`. (Cannot be negative.) |
| Maximum value `100000000000` (10<sup>11</sup>) XRP. That's `100000000000000000` (10<sup>17</sup>) "drops". | Maximum value `9999999999999999e80`. | Maximum value `0x7FFFFFFFFFFFFFFF`. |
| Precise to the nearest "drop" (0.000001 XRP) | 15 decimal digits of precision. |
| Can't be [frozen](../../../concepts/tokens/fungible-tokens/freezes.md). | The issuer can [freeze](../../../concepts/tokens/fungible-tokens/freezes.md) balances. |
| No transfer fees; XRP-to-XRP payments are always direct. | Can take indirect [paths](../../../concepts/tokens/fungible-tokens/paths.md) with each issuer charging a percentage [transfer fee](../../../concepts/tokens/transfer-fees.md). |
| Can be used in [Payment Channels](../../../concepts/payment-types/payment-channels.md) and [Escrow](../../../concepts/payment-types/escrow.md). | Not compatible with Payment Channels or Escrow. |
| Can't be [frozen](../../../concepts/tokens/fungible-tokens/freezes.md). | The issuer can [freeze](../../../concepts/tokens/fungible-tokens/freezes.md) balances. | The issuer can lock balances individually and globally. |
| No transfer fees; XRP-to-XRP payments are always direct. | Can take indirect [paths](../../../concepts/tokens/fungible-tokens/paths.md) with each issuer charging a percentage [transfer fee](../../../concepts/tokens/transfer-fees.md). | Can charge a transfer fee for secondary sales of the token. |
| Can be used in [Payment Channels](../../../concepts/payment-types/payment-channels.md) and [Escrow](../../../concepts/payment-types/escrow.md). | Not compatible with Payment Channels or Escrow. | Not compatible with Payment Channels. Can be used for escrow. |
For more information, see [What is XRP?](../../../introduction/what-is-xrp.md) and [Tokens](../../../concepts/tokens/index.md).
See [What is XRP?](../../../introduction/what-is-xrp.md), [Tokens](../../../concepts/tokens/index.md), and [Multi-purpose Tokens](../../../concepts/tokens/fungible-tokens/multi-purpose-tokens.md).
## Specifying Currency Amounts
@@ -36,6 +39,7 @@ Use the appropriate format for the type of currency you want to specify:
- [XRP Amounts](#xrp-amounts)
- [Token Amounts](#token-amounts)
- [MPT Amounts](#mpt-amounts)
### XRP Amounts
@@ -72,6 +76,16 @@ For example, to represent $153.75 US dollars issued by account `r9cZA1mLK5R5Am25
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59"
}
```
### MPT Amounts
Specify the amount of MPTs using the `MPTAmount` field. For example, to specify 1 million units of an MPT you would specify:
```json
{
"MPTAmount": "1000000"
}
```
### Specifying Without Amounts
@@ -111,6 +125,10 @@ When sending token amounts in the XRP Ledger's peer-to-peer network, servers [se
{% admonition type="success" name="Tip" %}For tokens that should not be divisible at all, see [Non-Fungible Tokens (NFTs)](../../../concepts/tokens/nfts/index.md).{% /admonition %}
## MPT Precision
## Currency Codes
[Currency Code]: #currency-codes