Replies: 1 comment
-
This RFC has been promoted to an AIP (Archway Improvement Proposal) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Abstract
We propose a new module called
x/cw-registry
which can be used by contract deployers to provide metadata about their contracts.The module would store contract metadata such as source code, schema, developer contact info.
Context
Cosmwasm does not provide any way for a Cosmwasm smart contract developer to provide any metadata regarding their contracts. This has been explored in
x/wasm
before 1, where during contract binary upload, a developer could provide the source code url. This feature was deprecated by Confio due toDue to the nature of wasm, it is also not possible to take a look at the source code of a deployed contract.
Once a contract is deployed, it is not easy for external parties to get the contract schema and endpoints2, especially so in the case when the contract is closed source or source URL not available. Having this information available on chain would enable the following
Currently, there is no way for a user/another developer to know who deployed a contract. In case they would like to contact the developer, there isnt any way to do it beyond the deployer address. Adding a field for security contact would help others report issues.
Most of the Cosmwasm chains run as permissioned Cosmwasm, which allows for the contract source to be connected to the binary in the governance proposal. However, in the permissionless approach of Archway, there is no builtin way to establish this connection.
Architecture
The solution proposed is to develop a new sdk module
x/cw-registry
which will store the relevant information.The feature will be an opt in where developers can choose to provide only the necessary info that they deem important. e.g A developer might want to share the schema but might not want to share their source code url as their code is closed source.
Why module instead of modifying archway-wasmd?
x/wasmd
is purpose scoped to be a contract execution engine. Expanding the module to include code registry features will be beyond its scope.Why module instead of a name service contract?
The features required for the contract registry could be built either as a chain module or a smart contract. However, going by the philosophy of what a smart contract is, which is to build dapps, it does not make sense to put this feature in a smart contract as this is meant to be a metadata service which augments on the existing smart contract functionality provided by the chain. This feature is tighly coupled with the on chain contract management to be deployed as a smart contract.
Technical Specification
The module would store the following state for Code which has been deployed on chain:
This information can only be modified by the user who uploaded the contract binary. Even though Code IDs are unique to binary, we should make these fields modifyable over time to allow for fixing erroneous values and updating contacts.
Consequences
Backwards compatibility
Since the feature is being added as a new module, this should not cause any backwards compatibility issues.
Positive
Negative
Neutral
Footnotes
Question: Why was StoreCode.url removed from the tx msg? ↩
Upload JSON schema alongside code contract ↩
Beta Was this translation helpful? Give feedback.
All reactions