SEP: <to be assigned>
Title: Dynamic Asset Metadata
Author: OrbitLens <orbit...@gmail.com>, Paul Tiplady <pa...@qwil.com>
Status: Draft
Created: 2018-09-30
Updated: 2018-09-30
Version 0.1.0
This SEP extends SEP-0001
and adds the support of the dynamic asset metadata resolution. It
describes a standard way to query asset metadata, thereby allowing the
issuer to deal with an unlimited number of assets without defining each
of them in stellar.toml
file.
Current SEP-0001 specification works excellent for issuers that manage only a few assets. However, stellar.toml
has a size limit of 100 KB, effectively reducing the maximum possible
number of assets to ~300 per file. At present time there is no standard
way for the anchor to provide metadata for a large number of assets
issued by the same account. There are plenty of use-cases that require
thousands of separate assets: bonds, securities, futures, non-fungible
tokens.
To allow dynamic asset properties resolution, the issuer implements
described REST API endpoints and advertises the existence of a Dynamic
Asset Metadata Service through the stellar.toml
file. Top-level parameter ASSET_METADATA_SERVER
should contain a fully-qualified URL of a metadata resolution service.
Example of stellar.toml
:
ASSET_METADATA_SERVER="https://anchor.com/assets"
...
home_domain
for the asset issuing account and downloads stellar.toml
.[[CURRENCIES]]
section.[[CURRENCIES]]
section, the client checks for the top-level ASSET_METADATA_SERVER
parameter.ASSET_METADATA_SERVER
parameter.Dynamic Asset Metadata Service exposes two REST API endpoints.
GET <ASSET_METADATA_SERVER>/<ASSET_CODE>
This API endpoint returns the metadata for a particular asset. The
result of the invocation should contain asset metadata following the
parameter naming convention described in SEP-0001 for the [[CURRENCIES]]
section.
Request
Request Parameters:
Example: GET https://anchor.com/assets/AED
Response
On success, the endpoint should return 200 OK HTTP status code and TOML/JSON-encoded object containing asset metadata.
Depending on the value of the "Accept" request header the endpoint should return the response in JSON format for "application/json"
value or TOML format for "application/toml"
and "*/*"
wildcard (default).
Example:
code="AED"
name="United Arab Emirates Dirham"
issuer="GAOO3LWBC4XF6VWRP5ESJ6IBHAISVJMSBTALHOQM2EZG7Q477UWC6L7U"
display_decimals=2
GET <ASSET_METADATA_SERVER>
This API endpoint returns the list with metadata for all assets issued by the account. It follows Horizon REST API format convention.
Request
Request Parameters:
paging_token
in a result set)."asc"
(default) or "desc"
.20
, maximum 200
.Example: GET https://anchor.com/assets/?cursor=BOB&order=asc&limit=2
Response
On success, the endpoint should return 200 OK HTTP status code and JSON-encoded object containing the list of the issued assets' metadata. A response result should contain records and navigation links following Horizon response convention.
Example:
{
"_links": {
"self": {
},
"prev": {
},
"next": {
}
},
"_embedded": {
"records": [
{
"code": "BRL",
"issuer": "GAOO3LWBC4XF6VWRP5ESJ6IBHAISVJMSBTALHOQM2EZG7Q477UWC6L7U"
"name": "Brazil Real",
"paging_token": "BRL"
},
{
"code": "BSD",
"issuer": "GAOO3LWBC4XF6VWRP5ESJ6IBHAISVJMSBTALHOQM2EZG7Q477UWC6L7U"
"name": "Bahamas Dollar",
"paging_token": "BSD"
}
]
}
}
In order to comply with browser cross-origin access policies, the service should provide wildcard CORS response HTTP header. The following HTTP header must be set for both API endpoints:
Access-Control-Allow-Origin: *
The "asset metadata" endpoint should support both TOML and JSON format to simplify its usage with different client types.
Response in TOML format by default is intended to allow using the same parsing logic for both stellar.toml
and API response.
The "list all" endpoint provides a convenient interface for exchanges, ledger explorers, infrastructure apps, and external services.
GET https://anchor.com/assets/AED-GAOO3LWBC4XF6VWRP5ESJ6IBHAISVJMSBTALHOQM2EZG7Q477UWC6L7U
) but allows usage of the same server for all assets regardless of the issuer.You can also do a merkle trie so you get higher assurance that you can't include conflicting entries"
Seems like that maybe over complicates it? It also seems like we could add that later.
--
You received this message because you are subscribed to the Google Groups "Stellar Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stellar-dev...@googlegroups.com.
To post to this group, send email to stell...@googlegroups.com.
Visit this group at https://groups.google.com/group/stellar-dev.
To view this discussion on the web visit https://groups.google.com/d/msgid/stellar-dev/6f7a1029-406d-4ce4-ab51-45a93d1a150b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/stellar-dev/CALGT9GMGEJ2yLwgjRmtv6_7Zs0vAF5n%2BsZjhQRwUWpVXLhBe%2BQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/stellar-dev/CAJxYNoaTvq%2B73A-EPM4D6yuoFUfqxbQCSPk74QDTEry%2BHtr88A%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Stellar Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stellar-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/stellar-dev/c7fa077a-9821-453f-a5eb-4f0e43e39406n%40googlegroups.com.
VERSION="2.0.0"
NETWORK_PASSPHRASE="Public Global Stellar Network ; September 2015"
[DOCUMENTATION]
ORG_NAME="Organization Name"
[[CURRENCIES]]
toml="https://DOMAIN/.well-known/ABC.toml"
[[CURRENCIES]]
toml="https://DOMAIN/.well-known/DEF.toml"
[[CURRENCIES]]
code="ABC"
issuer="GAOO3LWBC4XF6VWRP5ESJ6IBHAISVJMSBTALHOQM2EZG7Q477UWA6L7U"
display_decimals=7
VERSION="2.0.0"
NETWORK_PASSPHRASE="Public Global Stellar Network ; September 2015"
INCLUDES=[
"https://DOMAIN/.well-known/CURRENCIES_PAGE_1.toml",
"https://DOMAIN/.well-known/CURRENCIES_PAGE_2.toml",
]
[DOCUMENTATION]
ORG_NAME="Organization Name"
[[CURRENCIES]]
toml="https://DOMAIN/.well-known/ABC.toml"
[[CURRENCIES]]
toml="https://DOMAIN/.well-known/DEF.toml"
[[CURRENCIES]]
code="ABC"
issuer="GAOO3LWBC4XF6VWRP5ESJ6IBHAISVJMSBTALHOQM2EZG7Q477UWA6L7U"
display_decimals=7
To view this discussion on the web visit https://groups.google.com/d/msgid/stellar-dev/1827339852.1330676.1645196230109%40privateemail.com.
CURRENCIES_TOMLS = [
To view this discussion on the web visit https://groups.google.com/d/msgid/stellar-dev/063e783f-6405-4009-8680-5d0ea7e64586n%40googlegroups.com.