You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CAIPs/caip-25.md
+57-1Lines changed: 57 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -82,7 +82,10 @@ e.g., one or more specific failure states MAY be sent (see [#### failure states]
82
82
83
83
After parsing and authorizing separately all the networks and capabilities within each, a respondent establishes a connection by returning a success response that organizes all authorized features of each authorized scope in a single unified object of `scopeObject`s called `sessionScopes`.
84
84
In the case of identically-keyed `scopeObject`s appearing in both top-level objects in the request (`requestedScopes` and `optionalScopes`), the identically-scoped objects MUST be merged in the response, since `sessionScopes` MUST NOT contain redundant keys (see examples below).
85
-
However, respondents MUST NOT restructure scopes (e.g., by folding properties from a [CAIP-2][]-keyed, chain-specific scope object into a [CAIP-104][]-keyed, namespace-wide scope object) as this may introduce ambiguities (See Security Considerations below).
85
+
86
+
However, respondents SHOULD exercise caution when restructuring scopes.
87
+
Folding properties from a [CAIP-2][]-keyed, chain-specific scope object into a [CAIP-104][]-keyed, namespace-wide scope object, for example, may introduce ambiguities or violate the law of Least Privilege;
88
+
it is safer, in such cases, to restructure in the opposite direction, i.e. from compact [CAIP-104] scopes into more verbose single-chain [CAIP-2] requests. (See Security Considerations below).
86
89
87
90
### Request
88
91
@@ -296,6 +299,9 @@ Regardless of caller trust level, the following error responses can reduce frict
296
299
- When provider does not recognize one or more requested notification(s)
297
300
- code = 5202
298
301
- message = "Unknown notification(s) requested"
302
+
- When a badly-formed request includes a network reference invalid in that scope
303
+
- code = 5203
304
+
- message = "Chain reference invalid for given scope"
299
305
- When a badly-formed request defines one `chainId` two ways
300
306
- code = 5204
301
307
- message = "ChainId defined in two different scopes"
@@ -327,6 +333,55 @@ translate this object into other structures, preserving it in the CAIP-25
327
333
interface is crucial to the unambiguous communication between caller and
328
334
respondent about what exact authorization is granted.
329
335
336
+
### Ambiguity Between Different Types of Scopes
337
+
338
+
In the examples given above, there is no overlap between the two `eip155` chains authorized identically in compact form (1, 137) and the three additional chains identified in free-standing scopes (10, 42161, 0).
339
+
340
+
In cases where a given chain appears in both, it can be ambiguous what the intended behavior was.
341
+
Depending on the security posture of the respondent, the ambiguity MAY be rejected using error code 5204, or the respondent MAY err on the side of [Postel's Law permissiveness][postel], returning a disambiguated response with all authorizations for a given chain moved into a single scope to confirm the intention.
Note that the reference "10" has been moved out of the compact multi-reference scope, and that the union of all methods and notifications authorized to chainId reference `10` in both requested scopes has been granted to it in the latter.
382
+
Also note that the `accounts` array of both scope objects has been updated, as the `eip155:10` account is no longer valid in the compact scope after the removal of `10` from the `references` array; likewise, the union of the compact scope's array and the empty array of the requested `eip155:10` scope, minus the invalid terms, leaves an array with only one member, an `eip155:10` account.
383
+
384
+
330
385
## Privacy Considerations
331
386
332
387
One major risk in browser-based or HTTP-based communications is "fingerprinting
0 commit comments