[SEP] Contract Home Domain Interface: a home_domain() getter for Soroban contracts #1966
Replies: 2 comments 7 replies
|
Good idea 👍 For SEP-50, we do have We could have a common function to point to a SEP-1 file. Though the SEP-1 spec is too me a bit outdated. We could have more on NFT and contract based assets. I also found myself wanting to use this file for something else. (Also leaving a note here with my vandeta about https to say that we should generalize and even promote other protocols such as IPFS or even Iroh now that there is a v1.) |
|
Something I didn't see mentioned in the above conversation was SEP-42. This SEP doesn't address the on-chain --> off-chain link, like this discussion is focused on, but the reason I bring it up is because it offers a better trust model than SEP-1. SEP-1's SEP-42 allows applications to trust the maintainer of an asset list, which means the data included in the list is not just correct but also all tokens listed are safe. When Freighter looks up a token, it first checks if the token is included in a trusted asset list, and if it is, we use the metadata included in the list entry, instead of the metadata referenced in the stellar.toml file of the domain referenced on the issuer's My point here is that we prefer to source metadata from trusted sources, and maybe the ecosystem generally should consider doing the same. The absence of a SEP for a |
Uh oh!
There was an error while loading. Please reload this page.
What I'm proposing
A minimal, optional SEP defining a single read-only getter,
home_domain() -> String, that lets any Soroban contract declare the domain hosting its SEP-1stellar.toml. The goal is to restore, for contract-based assets, the on-chain to off-chain metadata link that classic Stellar assets already get from the issuing account'shome_domainfield.Prior context
This has come up twice as something that deserves its own standalone SEP, and I'd like to write it:
fn home_domain() -> Stringwas suggested, with the note that SEP-41 and SEP-50 could reference it so certainstellar.tomlfields become relevant when it is implemented.The gap
SEP-41 intentionally exposes only
name,symbol, anddecimalson-chain and is disconnected fromstellar.toml. As a result, a Soroban-native token or NFT has no standard way to point back to a domain for the richer, updatable, human-facing metadata (description, image, organization and legal info) that classic assets resolve through SEP-1 today. Every project reinvents discovery, and wallets, explorers, and indexers cannot resolve contract-asset metadata uniformly.Sketch of the interface
Consumer resolution flow for a contract address
C:C.home_domain(). If empty, no off-chain metadata is declared; stop.https://{home_domain}/.well-known/stellar.tomlover HTTPS.[[CURRENCY]]entry that identifies this contract by its contract address.C.The function is a getter: no authorization, no state requirement. How a contract stores the value (constant, instance storage, or admin-settable) is left to the implementer.
Open questions I'd like feedback on before drafting
[[CURRENCY]]entry already be matched to a contract address, or is a small SEP-1 companion change needed to make step 3 unambiguous?stellar.tomlalso listing the contract address, for anti-spoofing) be in scope here, or kept as a separate SEP?Reference implementation
If there's appetite, I'll provide a soroban-sdk reference implementation of
home_domain()plus a consumer-side resolver that returns the SEP-1 metadata for a given contract address.@leighmcculloch you sketched this
home_domain()shape in #1674. Does a standalone SEP match what you had in mind, and is the instance-level getter the design you'd prefer over a contract-meta key?All reactions