Skip to content

Commit fdd7fb6

Browse files
committed
Add MPT Metadata Schema section to concept docs
- Updates MPT Concept docs with metadata schema - Updates issue-mpt-with-metdata example code with new schema changes.
1 parent e1b97f7 commit fdd7fb6

File tree

3 files changed

+118
-30
lines changed

3 files changed

+118
-30
lines changed

_code-samples/issue-mpt-with-metadata/js/issue-mpt-with-metadata.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,26 @@ const { wallet } = await client.fundWallet()
1010

1111
// Define metadata as JSON
1212
const mpt_metadata = {
13-
ticker: 'TBILL',
14-
name: 'T-Bill Yield Token',
15-
desc: 'A yield-bearing stablecoin backed by short-term U.S. Treasuries and money market instruments.',
16-
icon: 'https://example.org/tbill-icon.png',
17-
asset_class: 'rwa',
18-
asset_subclass: 'treasury',
19-
issuer_name: 'Example Yield Co.',
20-
urls: [
13+
t: 'TBILL',
14+
n: 'T-Bill Yield Token',
15+
d: 'A yield-bearing stablecoin backed by short-term U.S. Treasuries and money market instruments.',
16+
i: 'https://example.org/tbill-icon.png',
17+
ac: 'rwa',
18+
as: 'treasury',
19+
in: 'Example Yield Co.',
20+
us: [
2121
{
22-
url: 'https://exampleyield.co/tbill',
23-
type: 'website',
24-
title: 'Product Page'
22+
u: 'https://exampleyield.co/tbill',
23+
c: 'website',
24+
t: 'Product Page'
2525
},
2626
{
27-
url: 'https://exampleyield.co/docs',
28-
type: 'docs',
29-
title: 'Yield Token Docs'
27+
u: 'https://exampleyield.co/docs',
28+
c: 'docs',
29+
t: 'Yield Token Docs'
3030
}
3131
],
32-
additional_info: {
32+
ai: {
3333
interest_rate: '5.00%',
3434
interest_type: 'variable',
3535
yield_source: 'U.S. Treasury Bills',

_code-samples/issue-mpt-with-metadata/py/issue-mpt-with-metadata.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,26 @@
1212

1313
# Define metadata as JSON
1414
mpt_metadata = {
15-
"ticker": "TBILL",
16-
"name": "T-Bill Yield Token",
17-
"desc": "A yield-bearing stablecoin backed by short-term U.S. Treasuries and money market instruments.",
18-
"icon": "https://example.org/tbill-icon.png",
19-
"asset_class": "rwa",
20-
"asset_subclass": "treasury",
21-
"issuer_name": "Example Yield Co.",
22-
"urls": [
15+
"t": "TBILL",
16+
"n": "T-Bill Yield Token",
17+
"d": "A yield-bearing stablecoin backed by short-term U.S. Treasuries and money market instruments.",
18+
"i": "example.org/tbill-icon.png",
19+
"ac": "rwa",
20+
"as": "treasury",
21+
"in": "Example Yield Co.",
22+
"us": [
2323
{
24-
"url": "https://exampleyield.co/tbill",
25-
"type": "website",
26-
"title": "Product Page"
24+
"u": "exampleyield.co/tbill",
25+
"c": "website",
26+
"t": "Product Page"
2727
},
2828
{
29-
"url": "https://exampleyield.co/docs",
30-
"type": "docs",
31-
"title": "Yield Token Docs"
29+
"u": "exampleyield.co/docs",
30+
"c": "docs",
31+
"t": "Yield Token Docs"
3232
}
3333
],
34-
"additional_info": {
34+
"ai": {
3535
"interest_rate": "5.00%",
3636
"interest_type": "variable",
3737
"yield_source": "U.S. Treasury Bills",

docs/concepts/tokens/fungible-tokens/multi-purpose-tokens.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,94 @@ Every MPT issuance has a set of key properties defined in the ledger as an [MPTo
4545

4646
After the MPT is issued, the on-chain data cannot be changed. However, the proposed [XLS-94: Dynamic MPT standard](https://github.com/XRPLF/XRPL-Standards/tree/master/XLS-0094-dynamic-MPT) {% not-enabled /%} would allow fields to be marked as mutable during creation, so that those fields can be changed later.
4747

48+
#### Metadata Schema
49+
50+
To fit within the 1024-byte limit, MPT metadata must use compressed JSON keys. The following table describes these keys and their corresponding fields:
51+
52+
| Field Name | Key | Type | Required? | Description |
53+
|:--------------- |:---- |:---------------- |---------- |-------------|
54+
| ticker | `t` | String | Yes | The ticker symbol used to represent the token. Must be uppercase letters (A-Z) and digits (0-9) only. A maximum of 6 characters is recommended. |
55+
| name | `n` | String | Yes | The display name of the token. Any UTF-8 string is permitted. |
56+
| desc | `d` | String | No | A short description of the token. Any UTF-8 string is permitted. |
57+
| icon | `i` | String | Yes | The URI to the token icon. Can be `hostname/path` (HTTPS is assumed), or full URI for other protocols. |
58+
| asset_class | `ac` | String | Yes️ | Categorizes tokens by their primary purpose and backing. See [Asset Class](#asset-class) for more details. |
59+
| asset_subclass | `as` | String | No | An optional subcategory that is only required if the `asset_class` is `rwa`. See [Asset Subclass](#asset-subclass) for more details. |
60+
| issuer_name | `in` | String | Yes | Name of the entity issuing the token. Any UTF-8 string is permitted. |
61+
| uris | `us` | Array | No | The list of related URIs such as website, documentation, and social media. See [URIs](#uris) for more details.|
62+
| additional_info | `ai` | Object or String | No | Freeform field for key token details like interest rate, maturity date, term, or other relevant info. Any valid JSON object or UTF-8 string is permitted. |
63+
64+
##### Asset Class
65+
66+
The `asset_class` field categorizes tokens by their primary purpose and backing. These categories help applications understand the nature of the token and its intended use case.
67+
68+
| Category | Definition |
69+
|----------|------------|
70+
| `rwa` | Tokens representing real-world assets (RWAs), which derive value from legally enforceable claims on physical or off-chain financial assets. |
71+
| `memes` | Community-driven tokens without intrinsic backing or utility claims, primarily driven by internet culture or speculation. |
72+
| `wrapped` | Tokens representing assets from other blockchains, typically backed 1:1 by bridges or custodians. |
73+
| `gaming` | Tokens used in games or virtual worlds, often representing in-game currency, assets, or rewards. |
74+
| `defi` | Tokens native to or used within DeFi protocols, including governance tokens, DEX tokens, and lending assets. |
75+
| `other` | Tokens that do not clearly fit into the defined categories. This may include experimental, test, or tokens with unique use cases not covered elsewhere. |
76+
77+
##### Asset Subclass
78+
79+
When `asset_class` is set to `rwa`, an `asset_subclass` can be specified to provide more granular categorization. This describes what type of real-world asset backs the token and what legal or regulatory framework might apply.
80+
81+
| Subclass | Definition |
82+
|----------|------------|
83+
| `stablecoin` | Tokens pegged to a stable value, typically fiat currencies like USD, which are backed by reserves like cash, treasuries, or crypto collateral. |
84+
| `commodity` | Tokens that represent physical commodities like gold, silver, or oil, often redeemable or legally linked to off-chain reserves. |
85+
| `real_estate` | Tokens representing ownership or claims on real estate, including fractionalized property shares or REIT-like instruments. |
86+
| `private_credit` | Tokens representing debt obligations from private entities, such as loans, invoices, or receivables. |
87+
| `equity` | Tokens representing ownership shares in companies, similar to traditional stock or equity instruments. |
88+
| `treasury` | Tokens backed by government debt instruments, such as U.S. Treasury bills or bonds. |
89+
| `other` | Tokens that do not fit into the predefined categories, including experimental, hybrid, or emerging real-world asset types. |
90+
91+
##### URIs
92+
93+
The `us` array contains related links with categorization to help applications display them appropriately. Each URI object requires a URI, category, and human-readable title.
94+
95+
| Field Name | Key | Type | Required? | Description |
96+
|:---------- |:--- |:------ |:--------- |:-------------|
97+
| uri | `u` | String | Yes️ |`hostname/path` or full URI to the related resource. |
98+
| category | `c` | String | Yes | The category of the link provided. Allowed values are: `website`, `social`, `docs`, `other`. |
99+
| title | `t` | String | Yes | Human-readable label for the link. |
100+
101+
#### Example JSON Metadata
102+
103+
The following example shows metadata for a treasury-backed token.
104+
105+
```json
106+
{
107+
"t": "TBILL",
108+
"n": "T-Bill Yield Token",
109+
"d": "A yield-bearing stablecoin backed by short-term U.S. Treasuries and money market instruments.",
110+
"i": "example.org/tbill-icon.png",
111+
"ac": "rwa",
112+
"as": "treasury",
113+
"in": "Example Yield Co.",
114+
"us": [
115+
{
116+
"u": "exampleyield.co/tbill",
117+
"c": "website",
118+
"t": "Product Page"
119+
},
120+
{
121+
"u": "exampleyield.co/docs",
122+
"c": "docs",
123+
"t": "Yield Token Docs"
124+
}
125+
],
126+
"ai": {
127+
"interest_rate": "5.00%",
128+
"interest_type": "variable",
129+
"yield_source": "U.S. Treasury Bills",
130+
"maturity_date": "2045-06-30",
131+
"cusip": "912796RX0"
132+
}
133+
}
134+
```
135+
48136
### Transferability Controls
49137

50138
MPTs can be configured with different levels of transferability controls by adjusting the following flags:

0 commit comments

Comments
 (0)