Skip to content

Commit 739e769

Browse files
committed
Add MPTs to basic data types and currency formats
1 parent 232860e commit 739e769

File tree

2 files changed

+38
-14
lines changed

2 files changed

+38
-14
lines changed

docs/references/protocol/data-types/basic-data-types.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,12 @@ XRP is specified as a string containing an integer number of "drops" of XRP, whe
129129
"issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"
130130
}
131131
```
132+
133+
- **MPT** - Use `MPTAmount` to specify the value of an MPT. To specify a value of 13.1 units of an MPT:
134+
135+
```
136+
"MPTAmount": 13.1
137+
```
132138
133139
For more information, see [Currency Formats](currency-formats.md).
134140

docs/references/protocol/data-types/currency-formats.md

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,40 @@ seo:
66
label:
77
- XRP
88
- Tokens
9+
- MPTs
910
---
1011
# Currency Formats
1112

12-
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.
13+
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.
14+
15+
_(Requires the [MPToken amendment][] {% not-enabled /%})_
1316

1417
## Comparison
1518

16-
The following table summarizes some of the differences between XRP and tokens in the XRP Ledger:
19+
The following table summarizes some of the differences XRP, tokens, and MPTs in the XRP Ledger:
1720

18-
| XRP | Tokens |
19-
|:---------------------------------------------------------|:------------------|
20-
| Has no issuer. | Always issued by an XRP Ledger account. |
21-
| Specified as a string. | Specified as an object. |
22-
| Tracked in [accounts](../ledger-data/ledger-entry-types/accountroot.md). | Tracked in [trust lines](../ledger-data/ledger-entry-types/ripplestate.md). |
23-
| Can never be created; can only be destroyed. | Can be issued or redeemed freely. |
24-
| Minimum value: `0`. (Cannot be negative.) | Minimum value: `-9999999999999999e80`. Minimum nonzero absolute value: `1000000000000000e-96`.
25-
| Maximum value `100000000000` (10<sup>11</sup>) XRP. That's `100000000000000000` (10<sup>17</sup>) "drops". | Maximum value `9999999999999999e80`. |
21+
| XRP | Tokens | MPTs |
22+
|:---------------------------------------------------------|:------------------|:---------------------|
23+
| Has no issuer. | Always issued by an XRP Ledger account. | Always issued by an XRP Ledger account. |
24+
| Specified as a string. | Specified as an object. | Specified as an object. |
25+
| 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. |
26+
| Can never be created; can only be destroyed. | Can be issued or redeemed freely. | Can be issued or redeemed freely. |
27+
| Minimum value: `0`. (Cannot be negative.) | Minimum value: `-9999999999999999e80`. Minimum nonzero absolute value: `1000000000000000e-96`. | Minimum value: `0`. (Cannot be negative.) |
28+
| Maximum value `100000000000` (10<sup>11</sup>) XRP. That's `100000000000000000` (10<sup>17</sup>) "drops". | Maximum value `9999999999999999e80`. | Maximum value `0x7FFFFFFFFFFFFFFF`. |
2629
| Precise to the nearest "drop" (0.000001 XRP) | 15 decimal digits of precision. |
27-
| Can't be [frozen](../../../concepts/tokens/fungible-tokens/freezes.md). | The issuer can [freeze](../../../concepts/tokens/fungible-tokens/freezes.md) balances. |
28-
| 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). |
29-
| 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. |
30+
| 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. |
31+
| 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. |
32+
| 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. |
3033

31-
For more information, see [What is XRP?](../../../introduction/what-is-xrp.md) and [Tokens](../../../concepts/tokens/index.md).
34+
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).
3235

3336
## Specifying Currency Amounts
3437

3538
Use the appropriate format for the type of currency you want to specify:
3639

3740
- [XRP Amounts](#xrp-amounts)
3841
- [Token Amounts](#token-amounts)
42+
- [MPT Amounts](#mpt-amounts)
3943

4044
### XRP Amounts
4145

@@ -72,6 +76,16 @@ For example, to represent $153.75 US dollars issued by account `r9cZA1mLK5R5Am25
7276
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59"
7377
}
7478
```
79+
### MPT Amounts
80+
81+
Specify the amount of MPTs using the `MPTAmount` field. For example, to specify 1 million units of an MPT you would specify:
82+
83+
```json
84+
{
85+
"MPTAmount": "1000000"
86+
}
87+
```
88+
7589

7690
### Specifying Without Amounts
7791

@@ -111,6 +125,10 @@ When sending token amounts in the XRP Ledger's peer-to-peer network, servers [se
111125

112126
{% 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 %}
113127

128+
## MPT Precision
129+
130+
131+
114132
## Currency Codes
115133
[Currency Code]: #currency-codes
116134

0 commit comments

Comments
 (0)