-
Notifications
You must be signed in to change notification settings - Fork 99
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
AIP: x/cw-registry module #471
Comments
Kindly some additions to x/cw-registry Module with some kool new features in context of Dapp semantics, transaction traffic metric analysis, customer queries support! Additions to x/cw-registry Module: Types:
Msg Types:
Queries: QueryResolveContract QueryGetContractRecord Keeper:
Features: b. Tagging System: c. Rating System: d. Review System: Errors:
Store Prefixes:
Event:
Attributes: contract_addr: Address of the newly registered contract.
Attributes: contract_addr: Address of the contract being reviewed.
Attributes: contract_addr: Address of the rated contract.
Attributes: contract_addr: Address of the contract being tagged. metadata.json: tags.json: reviews.json: ratings.json: |
Excellent, well detailed discussion points, thank you! Architectural Design Considerations One thing we have to be very considerate of is the effect / implications of any feature on blockchain state and any potential of future mutability. Blockchain by its nature is immutable, or at least constrained to monotonic state updates, thus any on-chain feature needs to benefit from this attribute or have it as a requirement. Any features that do not are probably better implemented off-chain as a support / auxiliary service... however, these services / features may be another application specific blockchain. For example, a search feature requires indexing to make search more efficient. Indexing, especially when combined with tags / ratings, are by its nature dynamic. This translates to inefficiency when expressed in on-chain state due to the high mutability of the data and would thus be better to implement as an off-chain service from an architectural perspective. However, a full blown rating or reputation system is useful across many different scenarios and may possibly present an opportunity for an application specific blockchain, or smart contract complex, that is solely focused on this. Utilizing the protocol it can be coupled to numerous services (both contracts and even other chains) that require a censorship-resistant, verifiable, and pseudonymous rating and reputation system. But, it will come with some serious challenges of its own... scalability springs to mind! Separate Necessary- from Convenience Features A great exercise in this regard is to identify each feature as necessary or convenient. A simple way to distinguish this is to simply ask what it would take to achieve the desired outcome. For example, enhanced searching only requires additional indexing to be built or provided across already existing data, thus it can be classified as a convenience feature. Conversely, you may find that a specific convenience feature needs some additional state or metadata, which in turn makes this data a requirement. At this point, examine if it can be separated into distinct necessary and convenience features. Opportunity: From a Business Perspective Remember that services constitutes tertiary economic activity. Thus, if a specific convenience service could be of value to a larger number of users / developers within the ecosystem, it may well present an opportunity to build such a service for benefit, just as plumbers and electricians provide services to maintain and improve infrastructure. This is exactly the reason why Archway provides rewards mechanisms to ensure that any such services, deployed as contracts, have the opportunity to benefit both creator / maintainer, as well as the larger Archway ecosystem. Conclusion Hopefully the above provides some additional pointers and insights to help inspire, as well as shape thoughts and designs from an architectural perspective. |
Discussed in https://github.com/orgs/archway-network/discussions/16
Originally posted by spoo-bar September 15, 2023
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
The text was updated successfully, but these errors were encountered: