Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more metadata along with contract #251

Closed
4 tasks
ethanfrey opened this issue Aug 14, 2020 · 5 comments
Closed
4 tasks

Add more metadata along with contract #251

ethanfrey opened this issue Aug 14, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@ethanfrey
Copy link
Member

The builds on and extends #241 which is a great idea.

When we upload code, we upload a ~200kB wasm blob.
There is no reason we cannot add even 20kB of metadata like schemas and other references. Let's collect more ideas besides the JSON schemas and see which make sense:

I wonder if this makes sense to add all of them on the Code itself, or as annotations. In this case, the key technical items - schemas, ts interface, maybe source code would go on the Code. We would then allow any number of "Annotations" that can be attached to a Code blob, not only by the owner. These are suggestions, as {Type, URL} pairs

{
  Type: "cosmjs/cli",
  URL: "https://raw.githubusercontent.com/CosmWasm/cosmwasm-plus/master/contracts/cw20-base/helpers.ts",
  By: "coral162d3zk45ufaqke5wgcd3kh336k6p3kwwkdj3ma",
}

{
  Type: "dApp",
  URL: "https://dapps.coralnet.cosmwasm.com/cw20",
  By: "coral1e86v774dch5uwkks0cepw8mdz8a9flhhapvf6w",
}

// we can even add some "code review" type comments here as claims
{
  Type: "Audit",
  URL: "???",
  By: "coral1dyual04q9m3f0a7qsvfx4hvu8ceyrxw9yldp8w",
}

{
  Type: "Bug"
  URL: "???",
  By: "coral1dyual04q9m3f0a7qsvfx4hvu8ceyrxw9yldp8w",
}
@ethanfrey ethanfrey added the enhancement New feature or request label Aug 14, 2020
@ethanfrey
Copy link
Member Author

@alpe @webmaster128 I would be curious for your opinions here when you have time. Nothing urgent, just may be a nice polish for 1.0.

@alpe
Copy link
Contributor

alpe commented Aug 19, 2020

I like the idea to store metadata. 🌷
This can be very powerful feature for various use cases that people will come up with.
Though we need some structure and permissions in place at some point so that this does not go wild.
For example if everybody can add metadata to codes then how do we prevent scammers?
The metadata may be displayed in web UIs so it should be safe and (partly) human readable

I can imagine that we want to store metadata with codes and contracts separately. For example: the code was audited by xxxx, the contract UI runs on IP: yyyy

@ethanfrey
Copy link
Member Author

@webmaster128 any opinions, feedback here? I know cosmjs will be the largest provider/consumer of such metadata, so it would be good to know your desires to make the customer happy 😄

@webmaster128
Copy link
Member

Some of this data is good to have. I like the JSON Schema, as an interface description.

I'm highly sceptical with respect to TypeScript types. I don't consider the JSON Schema -> .d.ts super stable and would also avoid to have better support for one client technology than for others. JSON Schema is stable and universal.

As mentioned elsewhere, I think it is a serious security issue to add helper scripts to the chain. Users will execute them in a node process with their current user's pevillages no matter what they contain. I'd rather have a service that creates the helper scripts dynamically based on some variables than users storing arbitrary code on chain. Also things like fees and RPC endpoints are probably not stable for the lifetime of the contract.

Re: source code
As Ethan wisely noted, people will trust the source code if it is on chain, no matter matches the compiled code. Also is we are moving towards monolytic contract repos (like cosmwasm-plus), we suddenly get a very big source as the whole repo is part of the contract build.

@ethanfrey ethanfrey added this to the v1.0.0 milestone Aug 19, 2020
@alpe alpe mentioned this issue Oct 14, 2020
@ethanfrey
Copy link
Member Author

Closing for the same reason as #241 (comment)

This is too much logic to put in a blockchain, we should put that in an explorer "web app" or "api service" that allows a lot more fleixibllity to iterate and run long-lived tasks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants