From 075df93dcd3e4e8618a63347185790cb5100d44c Mon Sep 17 00:00:00 2001 From: Olaf Tomalka Date: Wed, 9 Nov 2022 00:49:41 +0100 Subject: [PATCH 01/11] Adde spec concerning Session tokens --- CAIPs/caip-25.md | 60 +++++++++++++++++++++++------------------------- CAIPs/caip-27.md | 36 ++++++++++++++++------------- CAIPs/caip-XX.md | 45 ++++++++++++++++++++++++++++++++++++ 3 files changed, 94 insertions(+), 47 deletions(-) create mode 100644 CAIPs/caip-XX.md diff --git a/CAIPs/caip-25.md b/CAIPs/caip-25.md index 647440b6..88a51918 100644 --- a/CAIPs/caip-25.md +++ b/CAIPs/caip-25.md @@ -7,7 +7,7 @@ status: Draft type: Standard created: 2020-10-14 updated: 2020-10-14 -requires: 2, 10 +requires: 2, 10, XX --- ## Simple Summary @@ -44,8 +44,8 @@ The application would interface with a provider to initiate a session by calling The JSON-RPC method is labelled as `caip_handshake` and expects two parameters: -* chains - array of CAIP-2 compliant chainId's -* methods - array of JSON-RPC methods expected to be used during the session +- chains - array of CAIP-2 compliant chainId's +- methods - array of JSON-RPC methods expected to be used during the session ### Response @@ -55,15 +55,18 @@ The wallet can respond to this method with either a success result or an error m The response MUST be a success result when the user approved accounts matching the requested chains to be exposed and the requested methods to be used. +The response MUST include `token` which is a `SessionToken` as defined in [caip-xx](./caip-XX). + An example of a successful response should match the following format: ```jsonc { - "id": 1, - "jsonrpc": "2.0", - "result": { - "accounts": ["eip155:1:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb"], - } + "id": 1, + "jsonrpc": "2.0", + "result": { + "token": "0xdeadbeef", + "accounts": ["eip155:1:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb"] + } } ``` @@ -71,40 +74,35 @@ The accounts returned as a result should match the requested chainId's and shoul #### Error - The response MUST NOT be a success result when the user disapproves the accounts matching the requested chains to be exposed or the requested methods are not approved or the requested chains are not supported by the wallet or the requested methods are not supported An example of an error response should match the following format: ```jsonc { - "id": 1, - "jsonrpc": "2.0", - "error": { - "code": 5000, - "message": "User disapproved requested chains", - } + "id": 1, + "jsonrpc": "2.0", + "error": { + "code": 5000, + "message": "User disapproved requested chains" + } } ``` The valid error messages codes are the following: -* When user disapproves exposing accounts to requested chains - * code = 5000 - * message = "User disapproved requested chains" -* When user disapproves accepting calls with the request methods - * code = 5001 - * message = "User disapproved requested methods" -* When wallet evaluates requested chains to not be supported - * code = 5100 - * message = "Requested chains are not supported" -* When wallet evaluates requested methods to not be supported - * code = 5101 - * message = "Requested methods are not supported" - -## Links - -n/a +- When user disapproves exposing accounts to requested chains + - code = 5000 + - message = "User disapproved requested chains" +- When user disapproves accepting calls with the request methods + - code = 5001 + - message = "User disapproved requested methods" +- When wallet evaluates requested chains to not be supported + - code = 5100 + - message = "Requested chains are not supported" +- When wallet evaluates requested methods to not be supported + - code = 5101 + - message = "Requested methods are not supported" ## Copyright diff --git a/CAIPs/caip-27.md b/CAIPs/caip-27.md index fcdc62f0..0505c031 100644 --- a/CAIPs/caip-27.md +++ b/CAIPs/caip-27.md @@ -6,7 +6,7 @@ discussions-to: https://github.com/ChainAgnostic/CAIPs/pull/27 status: Abandoned type: Standard created: 2020-12-12 -requires: 2 +requires: 2, 25, XX --- ## Simple Summary @@ -31,31 +31,35 @@ The application would interface with a provider to make request as follows: ```jsonc { - "id": 1, - "jsonrpc": "2.0", - "method": "caip_request", - "params": { - "chainId": "eip155:1", - "request": { - "method": "personal_sign", - "params": ["0x68656c6c6f20776f726c642c207369676e2074657374206d65737361676521", "0xa89Df33a6f26c29ea23A9Ff582E865C03132b140"] - } + "id": 1, + "jsonrpc": "2.0", + "method": "caip_request", + "params": { + "chainId": "eip155:1", + "token": "0xdeadbeef", + "request": { + "method": "personal_sign", + "params": [ + "0x68656c6c6f20776f726c642c207369676e2074657374206d65737361676521", + "0xa89Df33a6f26c29ea23A9Ff582E865C03132b140" + ] } + } } ``` -The JSON-RPC method is labelled as `caip_request` and expects two parameters: +The JSON-RPC method is labelled as `caip_request` and expects three parameters: -* chainId - CAIP-2 compatible chainId -* request - an object containing the fields: - * method - JSON-RPC method to request - * params - JSON-RPC parameters to request +- chainId - [CAIP-2](./caip-2.md) compatible chainId +- token - [CAIP-XX](./caip-xx.md) SessionToken for session opened using [CAIP-25](./caip-25.md). +- request - an object containing the fields: + - method - JSON-RPC method to request + - params - JSON-RPC parameters to request ### Response The wallet will respond to the requested with the targeted chain connection and it will return a response with a success result or error message. - ## Links n/a diff --git a/CAIPs/caip-XX.md b/CAIPs/caip-XX.md new file mode 100644 index 00000000..4e66fb06 --- /dev/null +++ b/CAIPs/caip-XX.md @@ -0,0 +1,45 @@ +--- +caip: +title: Session tokens +author: Olaf Tomalka (@ritave) +discussions-to: +status: Draft +type: Standard +created: 2022-11-09 +--- + +## Simple Summary + +This CAIP defines a token that is used to represent an open session when communicating with a wallet + +## Motivation + +Currently, wallets use different ways to manage open sessions, website origin, WalletConnect topics, etc. This becomes hard to implement and has different edge cases depending on the source. One way to identify an open session no matter the source of the session is required. + +## Specification + +> Such sections are considered non-normative. + +### Language + +The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", +"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and +"OPTIONAL" written in uppercase in this document are to be interpreted as described in [RFC 2119](https://www.ietf.org/rfc/rfc2119.txt) + +### Definition + +Whenever a CAIP uses a name `SessionToken` and has this CAIP in the `required` front-matter property, it SHALL be interpreted as reference to this specification. + +> Notice that there are no code constraints on the token value itself. This is by design and the value is implementation dependent. + +```typescript +type SessionToken = string; +``` + +`SessionToken` value MUST uniquely identify an open session. It MUST become invalid after a session is closed. + +It MUST be serializable into JSON. Serialization and later deserialization using JSON MUST result in the same value. + +## Copyright + +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). From ab7b48802832e13aa5a6691652c5868ee87b6688 Mon Sep 17 00:00:00 2001 From: Bumblefudge Date: Wed, 9 Nov 2022 11:15:59 +0000 Subject: [PATCH 02/11] assign caip# by pr# --- CAIPs/caip-XX.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CAIPs/caip-XX.md b/CAIPs/caip-XX.md index 4e66fb06..f361488c 100644 --- a/CAIPs/caip-XX.md +++ b/CAIPs/caip-XX.md @@ -1,5 +1,5 @@ --- -caip: +caip: 171 title: Session tokens author: Olaf Tomalka (@ritave) discussions-to: From a121ee905c7fd9bdda593f377e4151df083332a9 Mon Sep 17 00:00:00 2001 From: Bumblefudge Date: Wed, 9 Nov 2022 11:16:31 +0000 Subject: [PATCH 03/11] assign caip# by pr# --- CAIPs/caip-25.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CAIPs/caip-25.md b/CAIPs/caip-25.md index 88a51918..6e1e3992 100644 --- a/CAIPs/caip-25.md +++ b/CAIPs/caip-25.md @@ -7,7 +7,7 @@ status: Draft type: Standard created: 2020-10-14 updated: 2020-10-14 -requires: 2, 10, XX +requires: 2, 10, 171 --- ## Simple Summary @@ -55,7 +55,7 @@ The wallet can respond to this method with either a success result or an error m The response MUST be a success result when the user approved accounts matching the requested chains to be exposed and the requested methods to be used. -The response MUST include `token` which is a `SessionToken` as defined in [caip-xx](./caip-XX). +The response MUST include `token` which is a `SessionToken` as defined in [caip-171](./caip-171). An example of a successful response should match the following format: From 5bf4cff0cbfa4c805b8f96db4388dc4bbf84be37 Mon Sep 17 00:00:00 2001 From: Bumblefudge Date: Wed, 9 Nov 2022 11:17:05 +0000 Subject: [PATCH 04/11] assign caip# by pr# --- CAIPs/caip-27.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CAIPs/caip-27.md b/CAIPs/caip-27.md index 0505c031..e8fb183d 100644 --- a/CAIPs/caip-27.md +++ b/CAIPs/caip-27.md @@ -6,7 +6,7 @@ discussions-to: https://github.com/ChainAgnostic/CAIPs/pull/27 status: Abandoned type: Standard created: 2020-12-12 -requires: 2, 25, XX +requires: 2, 25, 171 --- ## Simple Summary @@ -51,7 +51,7 @@ The application would interface with a provider to make request as follows: The JSON-RPC method is labelled as `caip_request` and expects three parameters: - chainId - [CAIP-2](./caip-2.md) compatible chainId -- token - [CAIP-XX](./caip-xx.md) SessionToken for session opened using [CAIP-25](./caip-25.md). +- token - [CAIP-171](./caip-171.md) SessionToken for session opened using [CAIP-25](./caip-25.md). - request - an object containing the fields: - method - JSON-RPC method to request - params - JSON-RPC parameters to request From aa179bf00fc8e4407e70fd92839b0ae4e274e99e Mon Sep 17 00:00:00 2001 From: Olaf Tomalka Date: Wed, 9 Nov 2022 19:11:45 +0100 Subject: [PATCH 05/11] Fair branding --- CAIPs/caip-XX.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CAIPs/caip-XX.md b/CAIPs/caip-XX.md index f361488c..bb95865a 100644 --- a/CAIPs/caip-XX.md +++ b/CAIPs/caip-XX.md @@ -14,7 +14,7 @@ This CAIP defines a token that is used to represent an open session when communi ## Motivation -Currently, wallets use different ways to manage open sessions, website origin, WalletConnect topics, etc. This becomes hard to implement and has different edge cases depending on the source. One way to identify an open session no matter the source of the session is required. +Currently, wallets use different ways to manage open sessions, MetaMask maintains connection based on origin, WalletConnect uses topics, etc. This becomes hard to implement and has different edge cases depending on the source. One way to identify an open session no matter the source of the session is required. ## Specification From df895428e5a7bc398940b4b6b2bd4f6c2bbdd4af Mon Sep 17 00:00:00 2001 From: Bumblefudge Date: Fri, 11 Nov 2022 11:29:41 +0000 Subject: [PATCH 06/11] Rename caip-XX.md to caip-171.md --- CAIPs/{caip-XX.md => caip-171.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename CAIPs/{caip-XX.md => caip-171.md} (100%) diff --git a/CAIPs/caip-XX.md b/CAIPs/caip-171.md similarity index 100% rename from CAIPs/caip-XX.md rename to CAIPs/caip-171.md From 7f03ba0a8b9c50bf6ce4bd1a1467099102e56390 Mon Sep 17 00:00:00 2001 From: Olaf Tomalka Date: Mon, 14 Nov 2022 13:35:22 +0100 Subject: [PATCH 07/11] Moved caip-27 to new required format as well --- CAIPs/caip-27.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CAIPs/caip-27.md b/CAIPs/caip-27.md index 7dbdf07c..956e2b62 100644 --- a/CAIPs/caip-27.md +++ b/CAIPs/caip-27.md @@ -6,7 +6,7 @@ discussions-to: https://github.com/ChainAgnostic/CAIPs/pull/27 status: Draft type: Standard created: 2020-12-12 -requires: 2, 25, 171 +requires: ["2", "25", "171"] --- ## Simple Summary From 3260a33b2aa8cd80f85b53f7e263bb2c50b1945e Mon Sep 17 00:00:00 2001 From: By_caballero Date: Wed, 16 Nov 2022 12:07:18 +0100 Subject: [PATCH 08/11] wordsmithing and more explicit session assumptns --- CAIPs/caip-171.md | 43 +++++++++++++++++++++++++++++++------------ CAIPs/caip-25.md | 10 ++++++++-- CAIPs/caip-27.md | 36 +++++++++++++++++++++++++++--------- 3 files changed, 66 insertions(+), 23 deletions(-) diff --git a/CAIPs/caip-171.md b/CAIPs/caip-171.md index bb95865a..cd7327d1 100644 --- a/CAIPs/caip-171.md +++ b/CAIPs/caip-171.md @@ -1,6 +1,6 @@ --- caip: 171 -title: Session tokens +title: Session Identifiers author: Olaf Tomalka (@ritave) discussions-to: status: Draft @@ -10,11 +10,19 @@ created: 2022-11-09 ## Simple Summary -This CAIP defines a token that is used to represent an open session when communicating with a wallet +This CAIP defines an common identifier for representing an open session with a +wallet, including both in-browser session tokens and API-based connection IDs. ## Motivation -Currently, wallets use different ways to manage open sessions, MetaMask maintains connection based on origin, WalletConnect uses topics, etc. This becomes hard to implement and has different edge cases depending on the source. One way to identify an open session no matter the source of the session is required. +Currently, sessions with wallet clients are tracked differently across different +architectures: in-browser MetaMask sandboxes instance-specific connections based +on origin which are referred to by tokens in the browser, while WalletConnect +uses a topic-based pub/sub protocol keyed to a unique topic string, etc. +Aligning specific aspects of session state can be hard without shared +assumptions about session boundaries and tracking. A minimal assumption is that +sessions are tracked by identifiers, and that different actors can update the +session accordingly. ## Specification @@ -22,24 +30,35 @@ Currently, wallets use different ways to manage open sessions, MetaMask maintain ### Language -The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", -"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and -"OPTIONAL" written in uppercase in this document are to be interpreted as described in [RFC 2119](https://www.ietf.org/rfc/rfc2119.txt) +The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", +"SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" written in +uppercase in this document are to be interpreted as described in [RFC +2119](https://www.ietf.org/rfc/rfc2119.txt) ### Definition -Whenever a CAIP uses a name `SessionToken` and has this CAIP in the `required` front-matter property, it SHALL be interpreted as reference to this specification. +Whenever a CAIP uses a name `SessionIdentifier` and has this CAIP in the +`required` front-matter property, it SHALL be interpreted as reference to this +specification. -> Notice that there are no code constraints on the token value itself. This is by design and the value is implementation dependent. +> Notice that there are no code constraints on the token value except +> that it be expressed as a string with few reserve characters, under 256 +> characters in length. This is by design and the value is +> implementation-dependent. ```typescript type SessionToken = string; ``` -`SessionToken` value MUST uniquely identify an open session. It MUST become invalid after a session is closed. - -It MUST be serializable into JSON. Serialization and later deserialization using JSON MUST result in the same value. +Properties of the `sessionIdentifier` are as follows: +1. It MUST uniquely identify an open and stateful session. +1. It MUST identify a closeable session, and it MUST become invalid + after a session is closed. +1. It MUST remain the same as the identified session's state changes. +1. It MUST be serializable into JSON. Serialization and later deserialization using +JSON MUST result in the same value. ## Copyright -Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). +Copyright and related rights waived via +[CC0](https://creativecommons.org/publicdomain/zero/1.0/). diff --git a/CAIPs/caip-25.md b/CAIPs/caip-25.md index 473fba41..ca3c535e 100644 --- a/CAIPs/caip-25.md +++ b/CAIPs/caip-25.md @@ -80,7 +80,7 @@ The wallet can respond to this method with either a success result or an error m The response MUST be a success result when the user approved accounts matching the requested chains to be exposed and the requested methods to be used. -The response MUST include `token` which is a `SessionToken` as defined in [caip-171](./caip-171). +The response MUST include `session` which is a `SessionIdentifier` as defined in [caip-171](./caip-171). An example of a successful response should match the following format: @@ -89,7 +89,7 @@ An example of a successful response should match the following format: "id": 1, "jsonrpc": "2.0", "result": { - "token": "0xdeadbeef", + "session": "0xdeadbeef", "accounts": ["eip155:1:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb"] } } @@ -137,6 +137,12 @@ The valid error messages codes are the following: * code = 5102 * message = "Requested events are not supported" +## Changelog + +- 2022-11-26: add mandatory indexing by session identifier (i.e. CAIP-171 requirement) +- 2022-10-26: Addressed Berlin Gathering semantics issues and params syntax; + consolidated variants across issues and forks post-Amsterdam Gathering + ## Copyright Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). \ No newline at end of file diff --git a/CAIPs/caip-27.md b/CAIPs/caip-27.md index 956e2b62..f7d32661 100644 --- a/CAIPs/caip-27.md +++ b/CAIPs/caip-27.md @@ -6,24 +6,33 @@ discussions-to: https://github.com/ChainAgnostic/CAIPs/pull/27 status: Draft type: Standard created: 2020-12-12 +updated: 2022-11-16 requires: ["2", "25", "171"] --- ## Simple Summary -CAIP-27 defines a standard JSON-RPC method for requesting to a target chain +CAIP-27 defines a standard JSON-RPC method for requesting methods mapped to a +target chain. ## Abstract -This proposal has the goal to define a standard method for decentralization applications to request JSON-RPC requests from cryptocurrency wallets directly to a target chain. +This proposal has the goal to define a standard method for decentralization +applications to request JSON-RPC methods from cryptocurrency wallets directed to +a given target chain. ## Motivation -The motivation comes from the ambiguity that comes from interfacing with multi-chain cryptocurrency wallets which may support the same methods for different chains and there is no indication of the chain that is being targeted by the decentralized application. +The motivation comes from the ambiguity that comes from interfacing with +multi-chain cryptocurrency wallets which may support the same methods for +different chains and there is no indication of the chain that is being targeted +by the decentralized application. ## Specification -The JSON-RPC provider is able to make any JSON-RPC requests accompanied by a [CAIP-2](https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-2.md) compatible chainId's +The JSON-RPC provider is able to make one or more JSON-RPC requests accompanied +by a [CAIP-2][] compatible `chainId` and a keyed to a specific [CAIP-171][] +session. ### Request @@ -36,7 +45,7 @@ The application would interface with a provider to make request as follows: "method": "caip_request", "params": { "chainId": "eip155:1", - "token": "0xdeadbeef", + "session": "0xdeadbeef", "request": { "method": "personal_sign", "params": [ @@ -50,19 +59,28 @@ The application would interface with a provider to make request as follows: The JSON-RPC method is labelled as `caip_request` and expects three parameters: -- chainId - [CAIP-2](./caip-2.md) compatible chainId -- token - [CAIP-171](./caip-171.md) SessionToken for session opened using [CAIP-25](./caip-25.md). +- chainId - [CAIP-2][]-defined `chainId` to identify both a namespace and a + specific chain or network within it +- session - [CAIP-171][] `SessionToken` to identify the session opened or + updated by a [CAIP-25][] interaction. - request - an object containing the fields: - method - JSON-RPC method to request - params - JSON-RPC parameters to request ### Response -The wallet will respond to the requested with the targeted chain connection and it will return a response with a success result or error message. +The wallet will respond to the requested with the targeted chain connection and +it will return a response with a success result or error message. + +## Changelog + +- 2022-11-26: add mandatory indexing by session identifier (i.e. CAIP-171 requirement) ## Links -n/a +[CAIP-2]: https://chainagnostic.org/CAIPs/caip-2 +[CAIP-25]: https://chainagnostic.org/CAIPs/caip-25 +[CAIP-171]: https://chainagnostic.org/CAIPs/caip-171 ## Copyright From da7e63ac95ed253c8bdab6819a0fc4a673fadb11 Mon Sep 17 00:00:00 2001 From: Bumblefudge Date: Wed, 16 Nov 2022 17:31:18 +0100 Subject: [PATCH 09/11] typo Co-authored-by: Olaf Tomalka --- CAIPs/caip-171.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CAIPs/caip-171.md b/CAIPs/caip-171.md index cd7327d1..56f69629 100644 --- a/CAIPs/caip-171.md +++ b/CAIPs/caip-171.md @@ -47,7 +47,7 @@ specification. > implementation-dependent. ```typescript -type SessionToken = string; +type SessionIdentifier = string; ``` Properties of the `sessionIdentifier` are as follows: From f6c9c61c90cb45738b47f5c40bb3c08758078c5a Mon Sep 17 00:00:00 2001 From: Bumblefudge Date: Wed, 16 Nov 2022 17:31:36 +0100 Subject: [PATCH 10/11] typo Co-authored-by: Olaf Tomalka --- CAIPs/caip-171.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CAIPs/caip-171.md b/CAIPs/caip-171.md index 56f69629..785498e9 100644 --- a/CAIPs/caip-171.md +++ b/CAIPs/caip-171.md @@ -50,7 +50,7 @@ specification. type SessionIdentifier = string; ``` -Properties of the `sessionIdentifier` are as follows: +Properties of the `SessionIdentifier` are as follows: 1. It MUST uniquely identify an open and stateful session. 1. It MUST identify a closeable session, and it MUST become invalid after a session is closed. From 4b0fa47378d35632c419550149757b1de3a4baf0 Mon Sep 17 00:00:00 2001 From: By_caballero Date: Wed, 16 Nov 2022 17:40:37 +0100 Subject: [PATCH 11/11] formatting minutae + moving constraint to other pr --- CAIPs/caip-171.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/CAIPs/caip-171.md b/CAIPs/caip-171.md index 785498e9..2604b3a4 100644 --- a/CAIPs/caip-171.md +++ b/CAIPs/caip-171.md @@ -37,14 +37,12 @@ uppercase in this document are to be interpreted as described in [RFC ### Definition -Whenever a CAIP uses a name `SessionIdentifier` and has this CAIP in the +Whenever a CAIP uses the name `SessionIdentifier` and has this CAIP in the `required` front-matter property, it SHALL be interpreted as reference to this specification. -> Notice that there are no code constraints on the token value except -> that it be expressed as a string with few reserve characters, under 256 -> characters in length. This is by design and the value is -> implementation-dependent. +> Notice that there are no code constraints on the token value. This is by +> design and the value is implementation-dependent. ```typescript type SessionIdentifier = string; @@ -52,10 +50,10 @@ type SessionIdentifier = string; Properties of the `SessionIdentifier` are as follows: 1. It MUST uniquely identify an open and stateful session. -1. It MUST identify a closeable session, and it MUST become invalid +2. It MUST identify a closeable session, and it MUST become invalid after a session is closed. -1. It MUST remain the same as the identified session's state changes. -1. It MUST be serializable into JSON. Serialization and later deserialization using +3. It MUST remain the same as the identified session's state changes. +4. It MUST be serializable into JSON. Serialization and later deserialization using JSON MUST result in the same value. ## Copyright