Skip to content

Commit 7be66d0

Browse files
committed
Introduce compact field keys for JSON metadata to reduce size of JSON metadata object
1 parent 9f200e5 commit 7be66d0

File tree

1 file changed

+33
-31
lines changed
  • XLS-0089-multi-purpose-token-metadata-schema

1 file changed

+33
-31
lines changed

XLS-0089-multi-purpose-token-metadata-schema/README.md

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,17 @@ MPTs include a 1024-byte field for arbitrary metadata. The metadata field is par
3838

3939
## 2. Base Metadata Schema
4040

41-
| Field | Description | Example | Allowed Values | Type | Required? |
42-
| ----------------- | ---------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------- | --------- |
43-
| `ticker` | Ticker symbol used to represent the token | EXMPL | Uppercase letters (A-Z) and digits (0-9) only. Max 6 characters recommended | string | ✔️ |
44-
| `name` | Display name of the token | Example Token | Any UTF-8 string | string | ✔️ |
45-
| `desc` | Short description of the token | A sample token used for demonstration | Any UTF-8 string | string | |
46-
| `icon` | URL to the token icon | https://example.org/token-icon.png | HTTPS URL that links to an image | string | ✔️ |
47-
| `asset_class` | Top-level classification of token purpose | rwa | rwa, memes, wrapped, gaming, defi, other | string | ✔️ |
48-
| `asset_subclass` | Optional subcategory, required if `asset_class = rwa` | See 2.2 _asset_subclass_ | See 2.2 _asset_subclass_ | string | |
49-
| `issuer_name` | The name of the issuer account | Example Issuer | Any UTF-8 string | string | ✔️ |
50-
| `urls` | List of related URLs (site, dashboard, social media, etc.) | See 2.3 _urls_ | See 2.3 _urls_ | array | |
51-
| `additional_info` | Freeform field for key token details like interest rate, maturity date, term, or other relevant info | `{ "interest_rate": "4.75%", "maturity_date": "2030-06-30", "term": "10Y", "issuer_type": "government" }` | Any valid JSON object or UTF-8 string | JSON object or string | |
41+
| Field | Key | Description | Example | Allowed Values | Type | Required? |
42+
| ----------------- | ---- | ---------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | --------------------- | --------- |
43+
| `ticker` | `t` | Ticker symbol used to represent the token | EXMPL | Uppercase letters (A-Z) and digits (0-9) only. Max 6 characters recommended | string | ✔️ |
44+
| `name` | `n` | Display name of the token | Example Token | Any UTF-8 string | string | ✔️ |
45+
| `desc` | `d` | Short description of the token | A sample token used for demonstration | Any UTF-8 string | string | |
46+
| `icon` | `i` | URL to the token icon | example.org/token-icon.png | `hostname/path` of an HTTPS URL that links to an image | string | ✔️ |
47+
| `asset_class` | `ac` | Top-level classification of token purpose | rwa | rwa, memes, wrapped, gaming, defi, other | string | ✔️ |
48+
| `asset_subclass` | `as` | Optional subcategory, required if `asset_class = rwa` | See 2.2 _asset_subclass_ | See 2.2 _asset_subclass_ | string | |
49+
| `issuer_name` | `in` | The name of the issuer account | Example Issuer | Any UTF-8 string | string | ✔️ |
50+
| `urls` | `us` | List of related URLs (site, dashboard, social media, etc.) | See 2.3 _urls_ | See 2.3 _urls_ | array | |
51+
| `additional_info` | `ai` | Freeform field for key token details like interest rate, maturity date, term, or other relevant info | `{ "interest_rate": "4.75%", "maturity_date": "2030-06-30", "term": "10Y", "issuer_type": "government" }` | Any valid JSON object or UTF-8 string | JSON object or string | |
5252

5353
---
5454

@@ -81,38 +81,40 @@ MPTs include a 1024-byte field for arbitrary metadata. The metadata field is par
8181

8282
### 2.3 urls
8383

84-
| Field | Description | Example | Allowed Values | Required |
85-
| ------- | ------------------------------------- | ----------------------------- | -------------------------------- | -------- |
86-
| `url` | The full link to the related resource | https://exampleyield.co/tbill | A valid HTTPS URL | ✔️ |
87-
| `type` | The category of the link | website | website, social, document, other | ✔️ |
88-
| `title` | A human-readable label for the link | Product Page | Any UTF-8 string | ✔️ |
84+
| Field | Key | Description | Example | Allowed Values | Required |
85+
| ---------- | ---- | ------------------------------------- | --------------------- | ---------------------------------------- | -------- |
86+
| `url` | `u` | The full link to the related resource | exampleyield.co/tbill | `hostname/path` of a valid HTTPS URL | ✔️ |
87+
| `category` | `c` | The category of the link | website | website, social, document, other | ✔️ |
88+
| `title` | `t` | A human-readable label for the link | Product Page | Any UTF-8 string | ✔️ |
8989

9090
---
9191

9292
### JSON Metadata example
9393

94+
Note: The Key values from the tables above are used as the property names in the JSON metadata object.
95+
9496
```json
9597
{
96-
"ticker": "TBILL",
97-
"name": "T-Bill Yield Token",
98-
"desc": "A yield-bearing stablecoin backed by short-term U.S. Treasuries and money market instruments.",
99-
"icon": "https://example.org/tbill-icon.png",
100-
"asset_class": "rwa",
101-
"asset_subclass": "treasury",
102-
"issuer_name": "Example Yield Co.",
103-
"urls": [
98+
"t": "TBILL",
99+
"n": "T-Bill Yield Token",
100+
"d": "A yield-bearing stablecoin backed by short-term U.S. Treasuries and money market instruments.",
101+
"i": "example.org/tbill-icon.png",
102+
"ac": "rwa",
103+
"as": "treasury",
104+
"in": "Example Yield Co.",
105+
"us": [
104106
{
105-
"url": "https://exampleyield.co/tbill",
106-
"type": "website",
107-
"title": "Product Page"
107+
"u": "exampleyield.co/tbill",
108+
"c": "website",
109+
"t": "Product Page"
108110
},
109111
{
110-
"url": "https://exampleyield.co/docs",
111-
"type": "docs",
112-
"title": "Yield Token Docs"
112+
"u": "exampleyield.co/docs",
113+
"c": "docs",
114+
"t": "Yield Token Docs"
113115
}
114116
],
115-
"additional_info": {
117+
"ai": {
116118
"interest_rate": "5.00%",
117119
"interest_type": "variable",
118120
"yield_source": "U.S. Treasury Bills",

0 commit comments

Comments
 (0)