Skip to content

Conversation

kuan121
Copy link

@kuan121 kuan121 commented Oct 3, 2025

High Level Changes

  1. Introduce compact keys for JSON metadata fields to reduce size of JSON metadata object
  2. Remove unnecessary URL scheme, i.e., HTTPS://

Why

This PR is meant to address WietseWind's comment in this discussion about reducing the size of JSON metadata object. With the proposed change, we can achieve a ~27.6% size reduction (from ~626 bytes to ~453 bytes) for the JSON Metadata example provided in XLS-89 Multi-Purpose Token Metadata Schema.

Before

JSON Metadata example (626 bytes)

{
  "ticker": "TBILL",
  "name": "T-Bill Yield Token",
  "desc": "A yield-bearing stablecoin backed by short-term U.S. Treasuries and money market instruments.",
  "icon": "https://example.org/tbill-icon.png",
  "asset_class": "rwa",
  "asset_subclass": "treasury",
  "issuer_name": "Example Yield Co.",
  "urls": [
    {
      "url": "https://exampleyield.co/tbill",
      "type": "website",
      "title": "Product Page"
    },
    {
      "url": "https://exampleyield.co/docs",
      "type": "docs",
      "title": "Yield Token Docs"
    }
  ],
  "additional_info": {
    "interest_rate": "5.00%",
    "interest_type": "variable",
    "yield_source": "U.S. Treasury Bills",
    "maturity_date": "2045-06-30",
    "cusip": "912796RX0"
  }
}

After

JSON Metadata example (453 bytes)

{
  "t": "TBILL",
  "n": "T-Bill Yield Token",
  "d": "A yield-bearing stablecoin backed by short-term U.S. Treasuries and money market instruments.",
  "i": "example.org/tbill-icon.png",
  "ac": "rwa",
  "as": "treasury",
  "in": "Example Yield Co.",
  "us": [
    {
      "u": "exampleyield.co/tbill",
      "c": "website",
      "t": "Product Page"
    },
    {
      "u": "exampleyield.co/docs",
      "c": "docs",
      "t": "Yield Token Docs"
    }
  ],
  "ai": {
    "interest_rate": "5.00%",
    "interest_type": "variable",
    "yield_source": "U.S. Treasury Bills",
    "maturity_date": "2045-06-30",
    "cusip": "912796RX0"
  }
}

@kuan121 kuan121 marked this pull request as ready for review October 3, 2025 21:11
@kuan121 kuan121 force-pushed the xls-0089-use-short-key-for-metadata-field branch from 7be66d0 to 4e2200f Compare October 3, 2025 21:54
@kuan121 kuan121 changed the title Introduce compact field keys for JSON metadata to reduce size of JSON metadata object Introduce compact keys for JSON metadata fields to reduce size of JSON metadata object Oct 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant