Contract metadata key registry #1752
Replies: 2 comments 2 replies
-
|
Re: Proposal: standard metadata keys Some context on why SEP-46 doesn’t contain a registry: It is primarily so that the definition of meta is decentralised, avoiding the issue of permissioning with regard to whether SDF or the SEPs author (me in the case of SEP-46) thinks a meta entry is worthy enough to be included. For the most part SEPs should be able to define meta keys they use and how they get used, and anyone needing to implement those SEPs will know how to use them and what they mean. Take the For meta driven by tooling, SEPs may not even be necessary. The Rust SDK has injected meta for a couple years without a SEP, and has been put to use by folks in different ways. If the proposal is some new meta fields like name, author, etc, that the hope is would be found on all contracts, that aren’t otherwise tied to any specific SEP or protocol but provides folks with a description (name, version, etc) of contracts, then that sounds like you could propose a new SEP focused on those meta, called something like “Descriptive Contract Meta”. Thoughts @janewang and others? |
Beta Was this translation helpful? Give feedback.
-
|
Re: Proposal: Metadata keys in Cargo toml file This look very cool. It's possible for the Rust SDK to inject the meta from the toml, so we could consider adding that capability to the Rust SDK so it gets picked up automatically by any build. We discussed doing this for the Something to consider and weigh is that meta via Contract meta can be injected today in two ways:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Background
Soroban contracts have WASM metadata, defined in SEP-46. This SEP describes how metadata should be stored in the WASM. However, this SEP doesn't have any guidance on what metadata keys could be stored there.
Motivation
With lack of centralized document with common keys it's hard to find which keys are used by other SEPs (unless you search other SEPs trying to find if they it turn support SEP-46), and some common tools (such as Soroban SDK)
Proposal: standard metadata keys
We should add metadata key registry to SEP-46.
We should not make any attempts to strictly standardize it (i.e. it's okay for SEP to not list some fields using by some libraries or tools, but they are free to add the keys they are using to this list). With SEP-9 we discovered that it's sometimes hard to predict the usage of the SEP by the ecosystem, and very often people are using some fields that are not defined by the SEP. Given that, I strongly suggest we do not make any keys mandatory, at least not for the 'minimal' contract (or use case).
That being said, another SEPs (such as contract version SEP-49) should define mandatory (for this SEP) metadata keys, and I think it's a good idea to keep this "common" keys in once place.
We could add a table of 'commonly used keys':
rsverrssdkvernameauthorshomepagerepositorybinversepProposal: Metadata keys in Cargo toml file
In addition, it would be nice to standardize following approach used in Scaffold Stellar -- it allows users to put contract metadata in the contract's Cargo toml file and I think it improves user experience and other tools could benefit from supporting this feature.
Example of Cargo toml:
And this is how it looks like when running
stellar contract info metaon it:Beta Was this translation helpful? Give feedback.
All reactions