Skip to content

Commit 1a91b0e

Browse files
authored
update syntax and example after 5792 syntax changes (#139)
2 parents fc2a442 + b43ffb5 commit 1a91b0e

File tree

1 file changed

+72
-28
lines changed

1 file changed

+72
-28
lines changed

eip155/caip25.md

Lines changed: 72 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ see the [eip155/caip211.md](./caip211.md) profile for further guidance on using
3434
No namespace-wide or network-specific session properties have yet been proposed for standardization.
3535
When crafting such properties for contextual/in-network usage, it is recommended to align one's semantics and syntax (including case-sensitive style guides for property names!) with the [EIP-6963] wallet provider interface (which extends the [EIP-1193] interface) for common properties across architectures, making sure to avoid any collisions.
3636

37-
Similarly, wherever possible, session properties should align closely with information passed as JSON objects by `wallet_` RPC methods, like capabilities or permissions. For example, the capability objects keyed to hexidecimal [EIP-155] `chainId`s defined as the expected return content of the `wallet_getCapabilities` method in [EIP-5792] should also be valid keyed the same way in `sessionProperties.capabilities`.
37+
Similarly, wherever possible, session properties should align closely with information passed as JSON objects by `wallet_` RPC methods, like capabilities or permissions.
38+
For example, the capability objects specified in [EIP-5792] get requested per-address via the `wallet_getCapabilities` RPC method, and the returned objects are partitioned by the hexadecimal chainId when chain-specific, and inside of an object keyed `0x00` (following the chainId 0 convention; see the [`eip155`/caip2 profile](caip2)) when universal to the `eip155` namespace.
39+
Should an application request these capabilities and a wallet choose to pre-declare at time of connection, both parties can put such objects in the appropriately-keyed `scopedProperties` partition for chain-specific capabilities and in the `sessionProperties` (unpartitioned) for `eip155`-wide capabilities;
40+
address-specific capabilities (or exceptions to override the capabilities of all other addresses in a given authorization scope) can be declared within address-keyed partitions.
41+
See the example below, equivalent to the illustrative examples in [EIP-5792].
3842

3943
## Examples
4044

@@ -52,7 +56,7 @@ Similarly, wherever possible, session properties should align closely with infor
5256
"methods": ["eth_sendTransaction", "eth_signTransaction", "eth_sign", "get_balance", "personal_sign"],
5357
"notifications": ["accountsChanged", "chainChanged"]
5458
},
55-
"eip155:10": {
59+
"eip155:8453": {
5660
"methods": ["get_balance"],
5761
"notifications": ["accountsChanged", "chainChanged"]
5862
},
@@ -65,16 +69,41 @@ Similarly, wherever possible, session properties should align closely with infor
6569
}
6670
},
6771
"optionalScopes":{
68-
"eip155:42161": {
72+
"eip155:84532": {
6973
"methods": ["eth_sendTransaction", "eth_signTransaction", "get_balance", "personal_sign"],
7074
"notifications": ["accountsChanged", "chainChanged"]
7175
},
7276
"sessionProperties": {
7377
"expiry": "2022-12-24T17:07:31+00:00",
78+
//universal capabilities (across all eip155 chains and addresses) can sit at the top-level of sessionProperties
7479
"caip154": {
75-
"supported":"true"
80+
"supported":"true"
81+
},
82+
"flow-control": {
83+
"loose": [],
84+
"strict": [],
85+
"exoticThirdThing": [] //caller is requesting a configuration-set which the wallet will drop as unrecognized
86+
},
87+
"atomic": {
88+
"status": "supported"
89+
}
90+
},
91+
"scopedProperties": {
92+
//chain-specific requests are made in scopedProperties per chain scope
93+
"eip155:8453": {
94+
"paymasterService": {
95+
"supported": true
96+
},
97+
"sessionKeys": {
98+
"supported": true
99+
}
100+
},
101+
"eip155:84532": {
102+
"auxiliaryFunds": {
103+
"supported": true
104+
}
76105
}
77-
}
106+
}
78107
}
79108
}
80109
```
@@ -94,15 +123,10 @@ Similarly, wherever possible, session properties should align closely with infor
94123
"notifications": ["accountsChanged", "chainChanged"],
95124
"accounts": ["eip155:1:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb", "eip155:137:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb"]
96125
},
97-
"eip155:10": {
98-
"methods": ["get_balance"],
99-
"notifications": ["accountsChanged", "chainChanged"],
100-
"accounts:" []
101-
},
102-
"eip155:42161": {
126+
"eip155:83532": {
103127
"methods": ["personal_sign"],
104128
"notifications": ["accountsChanged", "chainChanged"],
105-
"accounts":["eip155:42161:0x0910e12C68d02B561a34569E1367c9AAb42bd810"]
129+
"accounts":["eip155:83532:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb", "eip155:83532:0x0910e12C68d02B561a34569E1367c9AAb42bd810"]
106130
},
107131
"wallet": {
108132
"methods": ["wallet_getPermissions", "wallet_switchEthereumChain", "wallet_getCapabilities"],
@@ -113,23 +137,43 @@ Similarly, wherever possible, session properties should align closely with infor
113137
}
114138
},
115139
"sessionProperties": {
116-
"capabilities": {
117-
"0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb": {
118-
"0x31": {
119-
"paymasterService": {
120-
"supported": true
121-
},
122-
"sessionKeys": {
123-
"supported": true
124-
}
125-
},
126-
"0x3432313631": {
127-
"sessionKeys": {
128-
"supported": false
129-
}
130-
}
140+
"expiry": "2022-12-24T17:07:31+00:00",
141+
"caip154": {
142+
"supported":"true"
143+
},
144+
"flow-control": {
145+
"loose": ["halt", "continue"],
146+
"strict": ["continue"]
147+
},
148+
"atomic": {
149+
"status":"ready"
150+
}
151+
},
152+
"scopedProperties": {
153+
"eip155:1": {
154+
//capabilities shared across all address in a namespace can be expressed at top-level
155+
"atomic": {
156+
"status": "supported"
157+
}
158+
},
159+
"eip155:137": {
160+
"atomic": {
161+
"status": "unsupported"
162+
}
163+
},
164+
"eip155:84532": {
165+
//address-specific capabilities can be namespaced by address, and can include address-specific exceptions to scope-wide capabilities
166+
"eip155:83532:0x0910e12C68d02B561a34569E1367c9AAb42bd810": {
167+
"auxiliaryFunds": {
168+
"supported": false
169+
},
170+
"atomic": {
171+
"status": "supported"
131172
}
132-
}
173+
}
174+
//no need to respond with empty objects or declare implicit/default capabilities per-address, i.e. no empty capabilities object required for eip155:83532:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb to default to "ready"
175+
}
176+
133177
}
134178
}
135179
}

0 commit comments

Comments
 (0)