Soroban Token Metadata Storage #2054
Replies: 3 comments 7 replies
|
Should this also define a |
|
Two cases the reader side still has to guess at. If a token has both keys, or one map with both The values are also static by convention only. Any function in the contract can call |
|
Our SEP41 parser reads the data from Also, when reading through the functions like |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
SEP-41 intentionally doesn’t define how a token contract stores its state. In practice, though, most token contracts write their name, symbol, and decimals into instance storage in one of two well-known formats, and indexers, explorers, and ETLs have come to depend on reading them from there rather than running a Soroban host to simulate the getters.
From data that @sydneynotthecity shared, of the 1,587 Wasm token contracts on mainnet in October 2026, 89.7% use one of these formats.
Given the dependence of data products on reading this information it seems valuable to standardize the storage of meta for data products, with little disadvantage given the static nature of this information.
This SEP captures the existing practices:
Symbol("METADATA")first seen in the Stellar Asset Contract andsoroban-token-sdkVec([Symbol("Meta")])first seen in the OpenZeppelin Stellar Contracts libraryname,symbol, anddecimal(ordecimals).It doesn’t change SEP-41, and doesn’t replace the requirement for tokens to implement
decimals(),name(), andsymbol().Draft: https://github.com/stellar/stellar-protocol/blob/sep-token-metadata-storage/ecosystem/sep_tokenmetadatastorage.md
The developer docs already push developer in this direction too:
Note that those docs provide a looser definition, allowing the metadata to exist under any key. The proposed SEP does not recommend this due to the implications discussed in the security section of the proposal.
Why now? To encourage more tokens being developed to follow a consistent pattern, to avoid more cases like stellar/stellar-dbt-public#346.
Wdyt @sydneynotthecity?
All reactions