Replies: 14 comments 25 replies
-
by adding a handshake / session, we're layering a stateful protocol on top of a stateless protocol. so we must at least provide some guidance about the life cycle of the session. |
Beta Was this translation helpful? Give feedback.
-
@bumblefudge I'd like to loop back here on the threads we were discussing in our call this week: 1. Where should RPC connection metadata live in the CAIP-25 request. Briefly rehashing what we’re after here: In MetaMask we require certain metadata for users to add networks to their wallet (or for dapps to propose adding a network to a users wallet). I assume that the inclusion of 2. SessionIds shouldn’t be required. MetaMask has long lived connections with dapps in which the permissions granted via CAIP-25 requests are the single source of truth for the account/methods/chains permissions until they are revoked. In our current model these permissions persist if the user closes and reopens the dapp any number of times without any required re-instantiation of the permissions upon reconnection. Making sessionIds optional, allows the standard to be more agnostic to how wallets/dapps choose to manage their sessions. In some cases - as I assume for WC - permissions could be more tightly coupled to the actual connection between wallet and dapp or have an expiry in which cases its valuable for both sides to hold on to a sessionId to ensure they’re on the same page regarding the scope and status of the session. In our case we simply persist the permissions (by hostname) until revoked and allow the dapp to ask (via A message from @hmalik88 on this topic: “My position on the matter is pretty much simple, we should loosen the requirements around session ids to allow for more flexibility around client implementations of their respective permission systems. Not require session ids to be returned but if they are they should follow the already outlined requirements.” 3. Revoking Permissions: Currently CAIP-25 doesn’t clearly provide a path other than for creating a new sessions to revoke a previous session. Consider a “logout” or “disconnect” button on dapp in which a user wishes to fully terminate a session, how does a dapp implementating CAIP-25 handle such operations? 4. CAIP-217 shouldn’t allow namespace wild carded scopeObjects. We believe its not desirable to allow for permissioning unenumerated chains as is currently allowed in CAIP-25/217: Line 76 in b01678c This seems generally insecure but also makes adding incremental permissions for any given sub scope very complex. |
Beta Was this translation helpful? Give feedback.
-
@glitch-txs |
Beta Was this translation helpful? Give feedback.
-
I take Hassan to be saying (and what I'm saying) is that some wallets will use sessionIds and others simply will not
Ok so just so I'm clear on this flow you're imagining when this blanked out wallet comes back:
It seems to me the value of the sessionId is premised on the idea that both parties are always storing the permissions state. What if the dapp doesn't do so across refresh? Does this mean that the dapp will just request new permissions since it doesn't recognize the sessionId and therefore doesn't know what permissions it has? Why not just let the wallet be the single source of truth for permissions (if it wants to be) which the dapp can always query? I suppose you could argue that making the permissions set queryable is leaky but insofar as sessionIds are premised on the dapp tracking this info on its own it seems like the same thing to me. |
Beta Was this translation helpful? Give feedback.
-
🤔 so lets assume for now that we will use sessionIds in MetaMask, lets say a dapp has a "disconnect" or "logout" button and the user clicks it, it we wanted to fully end that "session" and not create a new one would we send a Ok now humor me and say sessionIds are optional (per #2 ☝️) and MetaMask is not using them at all, how then would we revoke a previous "sessions" permissions? I think perhaps there could/should be a separate method for this revocation operation? |
Beta Was this translation helpful? Give feedback.
-
I think it makes sense to have a revoke permissions method, CAIP-25 is being overloaded in a sense with many different concerns. I.e.:
Would be cool to have a separation of concerns with something like |
Beta Was this translation helpful? Give feedback.
-
I was summoned. Here are my quick takes: 1.
|
Beta Was this translation helpful? Give feedback.
-
Wanted to drop in another thought here: While I get the impulse behind
I have yet to encounter a dapp where the |
Beta Was this translation helpful? Give feedback.
-
Just want to loop back to this topic: @bumblefudge I hear your point:
But it still feels like it would be better to have some kindof options bucket where you can mixin some subjective/trust based values rather than polluting the |
Beta Was this translation helpful? Give feedback.
-
At the same time it does make new requirements of dapps interfacing with the extension. Now those dapps need to keep track of this sessionId and if they somehow lose it and say hey let me send a new one they lose all their permissions and have to request them again, instead of what they could do today in that scenario (if they lost track of what permissions they have) they could just call |
Beta Was this translation helpful? Give feedback.
-
Sorry folks for not being active here but as you can imagine CAIP-25 is a very important spec for WalletConnect protocol and I would like to chime in on several topics that were discussed here
|
Beta Was this translation helpful? Give feedback.
-
Crossposting this for visibility. I've opened a new CAIP proposal to add "lifecycle" methods as an alternative to session lifecycle management via |
Beta Was this translation helpful? Give feedback.
-
Thank you so much for the productive discussion yesterday @adonesky1 🙌 Looking forward to see your CAIP-285 updated with more context around the lifecycles Also to follow-up on the method renaming I would like to propose the following:
|
Beta Was this translation helpful? Give feedback.
-
I've created a PR to update both CAIP-25 to |
Beta Was this translation helpful? Give feedback.
-
I'm creating this discussion thread for discussing CAIP-25.
Beta Was this translation helpful? Give feedback.
All reactions