You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/references/protocol/data-types/basic-data-types.md
+10Lines changed: 10 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -129,6 +129,16 @@ XRP is specified as a string containing an integer number of "drops" of XRP, whe
129
129
"issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"
130
130
}
131
131
```
132
+
133
+
- **MPT** - Use `Amount` to specify the value of an MPT. Assuming an `AssetScale` of *1*, you would specify a value of 13.1 units of an MPT as follows:
Copy file name to clipboardExpand all lines: docs/references/protocol/data-types/currency-formats.md
+52-15Lines changed: 52 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -6,36 +6,40 @@ seo:
6
6
label:
7
7
- XRP
8
8
- Tokens
9
+
- MPTs
9
10
---
10
11
# Currency Formats
11
12
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 /%})_
13
16
14
17
## Comparison
15
18
16
-
The following table summarizes some of the differences between XRPand tokens in the XRP Ledger:
19
+
The following table summarizes some of the differences XRP, tokens, and MPTs in the XRP Ledger:
| 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. |
| 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. |
| Maximum value `100000000000` (10<sup>11</sup>) XRP. That's `100000000000000000` (10<sup>17</sup>) "drops". | Maximum value `9999999999999999e80`. | Maximum value `0x7FFFFFFFFFFFFFFF`. |
26
29
| 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 or Escrow. |
30
33
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).
32
35
33
36
## Specifying Currency Amounts
34
37
35
38
Use the appropriate format for the type of currency you want to specify:
36
39
37
40
-[XRP Amounts](#xrp-amounts)
38
41
-[Token Amounts](#token-amounts)
42
+
-[MPT Amounts](#mpt-amounts)
39
43
40
44
### XRP Amounts
41
45
@@ -51,7 +55,7 @@ XRP amounts cannot be negative.
51
55
52
56
### Token Amounts
53
57
54
-
To specify an amount of a [(fungible) token](../../../concepts/tokens/index.md), use an Amount object. This is a JSON object with three fields:
58
+
To specify an amount of a [(fungible) token](../../../concepts/tokens/index.md), use an `Amount` object. Tokens use the `currency`, `value`, and `issuer` fields.
|`mpt_issuance_id`| String | Arbitrary unique identifier for a Multi-purpose Token. |
86
+
|`value`|[String Number][]| A string representing a positive integer value. Valid values for this field are between 0x0 and 0x7FFFFFFFFFFFFFFF. Use `AssetScale` to enable values as fractions of the MPT value. See [MPT Precision](#mpt-precision). |
87
+
88
+
For example, to specify 1 million units of an MPT you would specify:
@@ -111,6 +134,20 @@ When sending token amounts in the XRP Ledger's peer-to-peer network, servers [se
111
134
112
135
{% 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 %}
113
136
137
+
## MPT Precision
138
+
139
+
MPTs are always expressed in whole integers. You can change the `AssetScale` of your MPT to express the basic unit as a fraction of an MPT. The XRP Ledger doesn't use the `AssetScale` on-chain: this is for your convenience in specifying the basic unit.
140
+
141
+
For example, to express a value of 13.1 MPT, the MPT would require that the `AssetScale` be set to 1, and the `value` of the MPT set to 131.
0 commit comments