Proposal RWA Asset Metadata and Oracle Extension #1878
aguilar1x
started this conversation in
Stellar Ecosystem Proposals
Replies: 2 comments
-
|
Great approach, RWAs are complex and there's no exact SEP approach to create one. T-REX it's great but here I see great improvements. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
This is great! RWAs need standardized metadata and extending the SEP-40 is a good solution to fix this. The issue that you mentioned that wallets/explorers get fragmented data is true! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Proposal
Simple Summary
A standard metadata schema for Real-World Asset (RWA) tokens on Stellar and
a Soroban oracle interface extension for storing and querying that metadata
on-chain.
Dependencies
stellar.toml.SEP extends.
(complementary — this SEP handles metadata and oracle, not compliance).
Motivation
RWA tokens on Stellar require standardized, verifiable metadata — asset
type, jurisdiction, valuation method, underlying asset details, legal
documentation and access to trustworthy price feeds that understand the
nature of the asset being quoted. Today each issuer defines ad-hoc metadata
and deploys custom oracle contracts. This fragmentation creates three
problems:
because there is no shared schema.
cannot access asset-level context such as type, jurisdiction, or
tokenization details, limiting risk assessment capabilities.
of implementing a single standard interface.
SEP-40 standardizes generic price feeds but has no concept of asset
metadata. SEP-57 (T-REX) standardizes regulated token operations
(compliance, identity, freezing) but does not address metadata or oracle
integration. This SEP fills the gap between both by defining:
and query functions.
RWA metadata from the oracle.
Abstract
This SEP introduces two complementary specifications:
A metadata schema describing RWA assets through a standardized set
of fields and enumerations. The schema can be published off-chain via
SEP-1 (
stellar.toml) as JSON, and on-chain via Soroban oraclecontracts.
A Soroban oracle extension interface that adds RWA metadata
functions on top of the SEP-40 price feed interface. An oracle
implementing this SEP MUST also implement SEP-40, and additionally
expose functions for registering, updating, and querying RWA metadata
and tokenization information.
The combination enables wallets, explorers, DeFi protocols, and token
contracts to discover and consume RWA information through a uniform
interface, regardless of the oracle provider or asset issuer.
Specification
1. RWA Metadata Schema
1.1 Off-Chain Representation (JSON)
RWA metadata MAY be published off-chain as JSON. Recommended hosting
methods:
[[CURRENCIES]]instellar.tomlper SEP-1.stellar.toml.Required fields:
{ "schema_version": "1.0", "asset_type": "REAL_ESTATE", "name": "Tokenized Office Building - 123 Main St", "underlying_asset": "Commercial real estate, Miami FL", "issuer": "G...", "jurisdiction": "US" }Optional fields:
{ "description": "Grade-A office building, 50,000 sq ft", "valuation_method": "APPRAISAL", "legal_docs_uri": "https://issuer.example/docs/offering.pdf", "external_ids": { "isin": "US000000001", "lei": "5493001KJTIIGC8Y1R12", "cusip": "000000001" }, "tokenization": { "token_contract": "C...", "total_supply": 1000000, "underlying_asset_id": "BLDG-123-MAIN", "tokenization_date": "2026-01-15" }, "metadata": { "maturity_date": "2031-01-15", "coupon_rate": "5.25", "audit_report_uri": "https://issuer.example/docs/audit-2025.pdf" } }1.2 Asset Type Enum
The
asset_typefield MUST be one of the following values:REAL_ESTATEEQUITYBONDCOMMODITYINVOICEFUNDPRIVATE_DEBTINFRASTRUCTUREOTHERIf
asset_typeisOTHER, the issuer SHOULD include anasset_type_detailstring describing the asset category.1.3 Valuation Method Enum
The optional
valuation_methodfield MUST be one of:APPRAISALMARKETINDEXORACLENAVOTHER2. On-Chain Data Types (Soroban)
The following Soroban contract types correspond to the JSON schema above
and are used by the oracle extension interface.
3. Oracle Extension Interface (Soroban)
An oracle implementing this SEP MUST implement the SEP-40
PriceFeedTraitinterface for price data, and MUST additionally implementthe following RWA metadata functions.
3.1 Admin Functions
These functions MUST require authorization from the oracle admin.
3.2 Query Functions
These functions MUST be callable by any account without authorization.
3.3 Relationship with SEP-40
An oracle implementing this SEP MUST also implement the following SEP-40
functions for price data:
base(env) -> Assetassets(env) -> Vec<Asset>decimals(env) -> u32resolution(env) -> u32lastprice(env, asset) -> Option<PriceData>price(env, asset, timestamp) -> Option<PriceData>prices(env, asset, records) -> Option<Vec<PriceData>>This SEP does not redefine any SEP-40 types or functions. The
Asset,PriceData, andPriceFeedTraitdefinitions from SEP-40 apply unchanged.4. Token Contract Integration Pattern
A token contract implementing SEP-41 (or SEP-57) MAY integrate with an
oracle implementing this SEP by storing the oracle contract address and
the asset symbol that identifies the token in the oracle.
4.1 Recommended Token Functions
Token contracts MAY expose the following convenience functions that proxy
oracle data:
4.2 Compliance Integration
This SEP does not define compliance logic. Token contracts requiring
compliance checks (identity verification, transfer restrictions, freezing)
SHOULD implement SEP-57 (T-REX), which provides a modular compliance and
identity verification framework. The oracle defined in this SEP is
complementary to SEP-57: the oracle provides asset-level metadata and
pricing, while SEP-57 provides participant-level compliance and
identity.
5. Price Staleness
Consumer contracts SHOULD verify that price data is not stale before
using it. The recommended check is:
Oracle operators SHOULD set
max_stalenessto a value appropriate for theasset class. For example:
Design Rationale
Why extend SEP-40 instead of a new oracle interface?
SEP-40 is the established oracle standard on Stellar, implemented by
Reflector and consumed by DeFi protocols. Defining a new parallel oracle
interface would fragment the ecosystem. By extending SEP-40, RWA oracles
remain compatible with existing consumers that only need price data, while
RWA-aware consumers can query the additional metadata functions.
Why both on-chain and off-chain metadata?
On-chain metadata (via oracle) enables smart contracts to consume asset
information programmatically a lending protocol can check
asset_typeto apply different collateral factors, orjurisdictiontoenforce geographic restrictions. Off-chain metadata (via SEP-1 JSON)
enables wallets and explorers to display rich information without
on-chain queries. Both channels serve different consumers and SHOULD
contain consistent data.
Why a fixed asset type enum?
A fixed enum enables wallets to display consistent icons, categories, and
risk indicators across all RWA tokens. The
OTHERvariant withasset_type_detailprovides an escape hatch for novel asset classes. Newenum values can be added in future versions of this SEP via the standard
SEP versioning process.
Why
external_idsas a key value vector?Different jurisdictions and asset classes use different identifier systems
(ISIN for securities, LEI for legal entities, CUSIP for North American
instruments). A key value structure avoids hard coding specific identifier
systems and allows the schema to accommodate any present or future
standard.
Security Concerns
Oracle Trust
Oracles are trusted dependencies. A compromised oracle can report
incorrect metadata or prices, leading to misinformed decisions by
consumers. Issuers and oracle operators SHOULD:
prices.
Off-Chain Metadata Integrity
Clients MUST treat off-chain JSON metadata (from
stellar.tomlor URIs)as untrusted. Where possible, clients SHOULD cross-reference off-chain
metadata with on-chain values stored in the oracle.
Price Staleness and Manipulation
Consumer contracts MUST check price timestamps against
max_stalenessbefore relying on price data. RWA assets are often illiquid, meaning price
updates may be infrequent and more susceptible to manipulation than
actively traded assets. Consumers SHOULD apply time-weighted averaging
(TWAP) where appropriate, per SEP-40 recommendations.
Metadata Mutability
Oracle admins can update metadata at any time via
set_rwa_metadata. Thisis necessary because RWA metadata legitimately changes (jurisdictions,
valuations, legal documents). However, consumers relying on metadata for
critical decisions SHOULD monitor metadata change events and re-evaluate
when changes occur.
Changelog
v0.0.1: Initial draft.Beta Was this translation helpful? Give feedback.
All reactions