-
Notifications
You must be signed in to change notification settings - Fork 147
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
CAIP-25: extensions
considered harmful?
#139
Comments
My 2 cents on the subject: Let's keep the JSON-RPC API spec to be as close to a 1-to-1 representation of the data that it is conveying. By not doing so (e.g. the "extensions" feature) we introduce a lot of unnecessary complexity (and eventually bugs) at the implementation level - basically requiring each integration to implement a "transpilation" step in order to extract the data from the request. I'd also edit the cosmos area of the proposed solution to be: {
"eip155:1": {
"methods": ["eth_sign"],
"events": ["accountsChanged"],
},
"eip155:137": {
"methods": ["eth_sign", "personalSign"],
"events": ["accountsChanged", "chainChanged"],
},
"cosmos:cosmoshub-4": {
"methods": ["cosmos_signDirect"],
"events": ["someCosmosEvent"]
},
"cosmos:cosmoshub-5": {
"methods": ["cosmos_signDirect"],
"events": ["someCosmosEvent"]
}
} |
Closed by #187 but feel free to open a new issue if not fully so! |
Ref: #138
Problem
When the dapp submits a CAIP-25 request, it may desire to request some methods or events for specific chains only, as opposed to the entire namespace. Given that top-level keys in the request object are namespaces, this presents a challenge. Consider:
The current WalletConnectV2 implementation of CAIP-25, solves this by adding a field named
extensions
to the namespace object:While this certainly works, it introduces complexity on the part of the wallet, which must essentially perform set operations (IIRC, the word used was "diffing") on the configuration for chains for which extensions are specified. Multiple people objected to this, and argued that a configuration format should explicitly state the configuration for each chain/namespace.
Proposed Solution
Instead of the
extensions
field, attendees suggested that top-level keys can be chain ids in addition to namespaces. This makes the object "literal" and ensures that no set operations have to be performed by the wallet during parsing:The text was updated successfully, but these errors were encountered: