From a085d33dd62c9a926465877872406ea2675d1c13 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Thu, 7 Mar 2019 09:29:32 -0500 Subject: [PATCH 01/17] Add initial signed message spec --- spec/ics-4-cosmos-signed-messages/README.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 spec/ics-4-cosmos-signed-messages/README.md diff --git a/spec/ics-4-cosmos-signed-messages/README.md b/spec/ics-4-cosmos-signed-messages/README.md new file mode 100644 index 000000000..32b852e0d --- /dev/null +++ b/spec/ics-4-cosmos-signed-messages/README.md @@ -0,0 +1,9 @@ +--- +ics: 4 +title: Cosmos Signed Messages +stage: draft +category: misc +author: Aleksandr Bezobchuk +created: 2019-03-07 +modified: 2019-03-07 +--- \ No newline at end of file From 07adec01ec9dc368da7dc72a1cd9e44a17d70a60 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Thu, 7 Mar 2019 09:33:20 -0500 Subject: [PATCH 02/17] Add section headers --- spec/ics-4-cosmos-signed-messages/README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/spec/ics-4-cosmos-signed-messages/README.md b/spec/ics-4-cosmos-signed-messages/README.md index 32b852e0d..ad0da7df3 100644 --- a/spec/ics-4-cosmos-signed-messages/README.md +++ b/spec/ics-4-cosmos-signed-messages/README.md @@ -6,4 +6,14 @@ category: misc author: Aleksandr Bezobchuk created: 2019-03-07 modified: 2019-03-07 ---- \ No newline at end of file +--- + +# Synopsis + +## Specification + +## History + +## Copyright + +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). \ No newline at end of file From f28e1244b5e9a0d45a434727c02d5dc7498d7e8a Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Thu, 7 Mar 2019 10:30:31 -0500 Subject: [PATCH 03/17] Add synopsis and desired props --- spec/ics-4-cosmos-signed-messages/README.md | 23 ++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/spec/ics-4-cosmos-signed-messages/README.md b/spec/ics-4-cosmos-signed-messages/README.md index ad0da7df3..a078740de 100644 --- a/spec/ics-4-cosmos-signed-messages/README.md +++ b/spec/ics-4-cosmos-signed-messages/README.md @@ -8,10 +8,31 @@ created: 2019-03-07 modified: 2019-03-07 --- -# Synopsis +## Synopsis + +Having the ability to sign messages off-chain has proven to be a fundamental aspect +of nearly any blockchain. The notion of signing messages off-chain has many +added benefits such as saving on computational costs and reducing transaction +throughput and overhead. Within the context of the Cosmos, some of the major +applications of signing such data includes, but is not limited to, providing a +cryptographic secure and verifiable means of proving validator identity and +possibly associating it with some other framework or organization. In addition, +having the ability to sign Cosmos messages with a Ledger or similar HSM device. + +A standardized protocol for hashing, signing, and verifying messages that can be +implemented by the Cosmos SDK and other third-party organizations is needed. ## Specification +### Desired Properties + +The Cosmos signed messages specification has the following desired properties: + +* Use of a secure cryptographic hash function +* Hash and sign over human-readable and machine-parsable messages +* Allow for signing over structured data +* Have builtin support for domain separation and replay protection + ## History ## Copyright From ec6ae4da5bd606e1629e44734fd1ffbe563c2693 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Thu, 7 Mar 2019 10:42:43 -0500 Subject: [PATCH 04/17] Update desired props --- spec/ics-4-cosmos-signed-messages/README.md | 23 +++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/spec/ics-4-cosmos-signed-messages/README.md b/spec/ics-4-cosmos-signed-messages/README.md index a078740de..813fcba07 100644 --- a/spec/ics-4-cosmos-signed-messages/README.md +++ b/spec/ics-4-cosmos-signed-messages/README.md @@ -26,12 +26,31 @@ implemented by the Cosmos SDK and other third-party organizations is needed. ### Desired Properties -The Cosmos signed messages specification has the following desired properties: +The Cosmos signed messages standardized protocol subscribes to the following: * Use of a secure cryptographic hash function * Hash and sign over human-readable and machine-parsable messages +* Is invulnerable to chosen ciphertext attacks * Allow for signing over structured data -* Have builtin support for domain separation and replay protection +* Contains a framework for deterministic and injective encoding of structured data +* Have builtin framework and support for domain separation and replay protection +* Has protection against potentially signing transactions a user did not intend to + +### Technical Specification + +(detailed technical specification: syntax, semantics, sub-protocols, algorithms, data structures, etc) + +### Backwards Compatibility + +(discussion of compatibility or lack thereof with previous standards) + +### Forwards Compatibility + +(discussion of compatibility or lack thereof with expected future standards) + +### Example Implementation + +(link to or description of concrete example implementation) ## History From 3db9b31f6df630bc4d14fbbacb42ea805bc957ef Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Thu, 7 Mar 2019 12:08:55 -0500 Subject: [PATCH 05/17] Update ICS number --- .../README.md | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) rename spec/{ics-4-cosmos-signed-messages => ics-15-cosmos-signed-messages}/README.md (67%) diff --git a/spec/ics-4-cosmos-signed-messages/README.md b/spec/ics-15-cosmos-signed-messages/README.md similarity index 67% rename from spec/ics-4-cosmos-signed-messages/README.md rename to spec/ics-15-cosmos-signed-messages/README.md index 813fcba07..7a199f5e6 100644 --- a/spec/ics-4-cosmos-signed-messages/README.md +++ b/spec/ics-15-cosmos-signed-messages/README.md @@ -1,5 +1,5 @@ --- -ics: 4 +ics: 15 title: Cosmos Signed Messages stage: draft category: misc @@ -26,9 +26,10 @@ implemented by the Cosmos SDK and other third-party organizations is needed. ### Desired Properties -The Cosmos signed messages standardized protocol subscribes to the following: +The Cosmos message signing standardized protocol subscribes to the following: -* Use of a secure cryptographic hash function +* Use of a secure cryptographic hash function (e.g. resistance to collision and second +pre-image attacks) * Hash and sign over human-readable and machine-parsable messages * Is invulnerable to chosen ciphertext attacks * Allow for signing over structured data @@ -38,7 +39,15 @@ The Cosmos signed messages standardized protocol subscribes to the following: ### Technical Specification -(detailed technical specification: syntax, semantics, sub-protocols, algorithms, data structures, etc) +The Cosmos message signing protocol will be parameterized over a secure +cryptographic hash function `H(x) → y` and a public key DSA `S → (sk, pk)`, where +`H` satisfies the desired properties such as having resistance to collision and +second pre-image attacks, as well as being +[deterministic](https://en.wikipedia.org/wiki/Hash_function#Determinism) and +[uniform](https://en.wikipedia.org/wiki/Hash_function#Uniformity) and where +`S` contains the operations signsk(x) → y and +verifypk(x, H) → true|false which provide digital +signatures over a set of bytes and verification of signatures respectively. ### Backwards Compatibility @@ -54,6 +63,8 @@ The Cosmos signed messages standardized protocol subscribes to the following: ## History +2019-03-07: Initial ICS 1 draft finished and submitted as a PR + ## Copyright Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). \ No newline at end of file From 46a127cc0bbd10e31213b19807ff59486c2cc4f7 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Thu, 7 Mar 2019 12:44:45 -0500 Subject: [PATCH 06/17] Update spec --- spec/ics-15-cosmos-signed-messages/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/spec/ics-15-cosmos-signed-messages/README.md b/spec/ics-15-cosmos-signed-messages/README.md index 7a199f5e6..66fb4c6d5 100644 --- a/spec/ics-15-cosmos-signed-messages/README.md +++ b/spec/ics-15-cosmos-signed-messages/README.md @@ -49,6 +49,21 @@ second pre-image attacks, as well as being verifypk(x, H) → true|false which provide digital signatures over a set of bytes and verification of signatures respectively. +Tendermint has a well established protocol for signing messages using a canonical +JSON representation as defined [here](https://github.com/tendermint/tendermint/blob/master/types/canonical.go). With the given canonical JSON structure, the specification requires +that they include the meta fields `@chain_id` and `@type`, both of which are strings. +These meta fields are **reserved** and **must** be included. In addition, the fields +must be ordered in lexicographically ascending order. + +For the purposes of signing Cosmos messages, the `@chain_id` field must correspond +to the Cosmos chain identifier. The user-agent should **refuse** signing if the +`@chain_id` field does not match the currently active chain! The `@type` field +corresponds to the type of structure the user will be signing in an application. + +Finally, the JSON representation must also include a `data` field whose value is +specific to the application and where the type corresponds to the value defined +by `@type`. + ### Backwards Compatibility (discussion of compatibility or lack thereof with previous standards) From 1b8e940eede4b2ee73b384be8834d2b0c8b0d78d Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Thu, 7 Mar 2019 13:14:36 -0500 Subject: [PATCH 07/17] Add note section of limited @type value --- spec/ics-15-cosmos-signed-messages/README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/spec/ics-15-cosmos-signed-messages/README.md b/spec/ics-15-cosmos-signed-messages/README.md index 66fb4c6d5..9cec816e5 100644 --- a/spec/ics-15-cosmos-signed-messages/README.md +++ b/spec/ics-15-cosmos-signed-messages/README.md @@ -60,9 +60,13 @@ to the Cosmos chain identifier. The user-agent should **refuse** signing if the `@chain_id` field does not match the currently active chain! The `@type` field corresponds to the type of structure the user will be signing in an application. -Finally, the JSON representation must also include a `data` field whose value is -specific to the application and where the type corresponds to the value defined -by `@type`. +Finally, the JSON representation must also include a `data` field where the type +corresponds to the value defined by the `@type` field. + +> __Note__: For now, the specification requires that a user is only allowed to +sign bytes of [valid](https://github.com/tendermint/tendermint/blob/master/libs/common/string.go#L61-L74) ASCII text. This requires that `@type` equals `"message"`. +However, this will change and evolve to support additional application-specific +structures that are human-readable and machine-verifiable (see below). ### Backwards Compatibility From 57e58c249d1bc677c5e0892c668ad9533edacd77 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Thu, 7 Mar 2019 13:15:32 -0500 Subject: [PATCH 08/17] Update README.md --- spec/ics-15-cosmos-signed-messages/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/ics-15-cosmos-signed-messages/README.md b/spec/ics-15-cosmos-signed-messages/README.md index 9cec816e5..3b1f8230d 100644 --- a/spec/ics-15-cosmos-signed-messages/README.md +++ b/spec/ics-15-cosmos-signed-messages/README.md @@ -64,7 +64,7 @@ Finally, the JSON representation must also include a `data` field where the type corresponds to the value defined by the `@type` field. > __Note__: For now, the specification requires that a user is only allowed to -sign bytes of [valid](https://github.com/tendermint/tendermint/blob/master/libs/common/string.go#L61-L74) ASCII text. This requires that `@type` equals `"message"`. +sign bytes of [valid](https://github.com/tendermint/tendermint/blob/master/libs/common/string.go#L61-L74) ASCII text. This requires that the `@type` field equals `"message"`. However, this will change and evolve to support additional application-specific structures that are human-readable and machine-verifiable (see below). From 1a1972cdfdd19c1e2bf533df89833793608d8d70 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Thu, 7 Mar 2019 13:17:51 -0500 Subject: [PATCH 09/17] Add JSON schema --- spec/ics-15-cosmos-signed-messages/README.md | 37 ++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/spec/ics-15-cosmos-signed-messages/README.md b/spec/ics-15-cosmos-signed-messages/README.md index 3b1f8230d..744a32444 100644 --- a/spec/ics-15-cosmos-signed-messages/README.md +++ b/spec/ics-15-cosmos-signed-messages/README.md @@ -68,6 +68,43 @@ sign bytes of [valid](https://github.com/tendermint/tendermint/blob/master/libs/ However, this will change and evolve to support additional application-specific structures that are human-readable and machine-verifiable (see below). +Thus, we can have a canonical JSON structure for signing Cosmos messages using +the [JSON schema](http://json-schema.org/) specification: + +```json +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$id": "cosmos/signing/typeData/schema", + "title": "The Cosmos signed message typed data schema.", + "type": "object", + "properties": { + "@chain_id": { + "type": "string", + "description": "The corresponding Cosmos chain identifier.", + "minLength": 1 + }, + "@type": { + "type": "string", + "description": "The message type. It must be 'message'.", + "enum": [ + "message" + ] + }, + "data": { + "type": "string", + "description": "The valid ASCII text to sign.", + "pattern": "^[\\x20-\\x7E]+$", + "minLength": 1 + } + }, + "required": [ + "@chain_id", + "@type", + "data" + ] +} +``` + ### Backwards Compatibility (discussion of compatibility or lack thereof with previous standards) From 303c7f34fa5144d41ca891c497ca71b55d2f3f92 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Thu, 7 Mar 2019 13:38:21 -0500 Subject: [PATCH 10/17] Add section on domain_separator --- spec/ics-15-cosmos-signed-messages/README.md | 24 ++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/spec/ics-15-cosmos-signed-messages/README.md b/spec/ics-15-cosmos-signed-messages/README.md index 744a32444..40a2650c0 100644 --- a/spec/ics-15-cosmos-signed-messages/README.md +++ b/spec/ics-15-cosmos-signed-messages/README.md @@ -60,8 +60,14 @@ to the Cosmos chain identifier. The user-agent should **refuse** signing if the `@chain_id` field does not match the currently active chain! The `@type` field corresponds to the type of structure the user will be signing in an application. -Finally, the JSON representation must also include a `data` field where the type -corresponds to the value defined by the `@type` field. +Having the ability to support domain separation of messages is also be vital as +just simply encoding messages is not sufficient. For example, some applications +may produce identical messages or structures and when signed can be valid on +both applications. Thus an optional field `domain_separator` may be provided which +is intended to include data that is specific to the application. Finally, the +JSON representation must also include a `data` field which is the application-specific +user supplied message and where the type corresponds to the value defined by the +`@type` field. > __Note__: For now, the specification requires that a user is only allowed to sign bytes of [valid](https://github.com/tendermint/tendermint/blob/master/libs/common/string.go#L61-L74) ASCII text. This requires that the `@type` field equals `"message"`. @@ -95,6 +101,12 @@ the [JSON schema](http://json-schema.org/) specification: "description": "The valid ASCII text to sign.", "pattern": "^[\\x20-\\x7E]+$", "minLength": 1 + }, + "domain_separator": { + "type": "string", + "description": "The application domain separator.", + "pattern": "^[\\x20-\\x7E]+$", + "minLength": 1 } }, "required": [ @@ -105,6 +117,14 @@ the [JSON schema](http://json-schema.org/) specification: } ``` +We define the following operations in signing and verifying Cosmos messages: + +TODO: + +#### Replay Protection + +TODO: + ### Backwards Compatibility (discussion of compatibility or lack thereof with previous standards) From 9250029e308d2c7c24cc30cb8bc7c1e15c4de890 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Thu, 7 Mar 2019 14:27:57 -0500 Subject: [PATCH 11/17] Update JSON schema to include replay protection --- spec/ics-15-cosmos-signed-messages/README.md | 35 ++++++++++++-------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/spec/ics-15-cosmos-signed-messages/README.md b/spec/ics-15-cosmos-signed-messages/README.md index 40a2650c0..6d919942f 100644 --- a/spec/ics-15-cosmos-signed-messages/README.md +++ b/spec/ics-15-cosmos-signed-messages/README.md @@ -64,10 +64,13 @@ Having the ability to support domain separation of messages is also be vital as just simply encoding messages is not sufficient. For example, some applications may produce identical messages or structures and when signed can be valid on both applications. Thus an optional field `domain_separator` may be provided which -is intended to include data that is specific to the application. Finally, the -JSON representation must also include a `data` field which is the application-specific -user supplied message and where the type corresponds to the value defined by the -`@type` field. +is intended to include data that is specific to the application. In addition, +client may provide optional replay protection data via the fields `nonce`, +`block_height`, and `timestamp`. + +Finally, the JSON representation must also include a `data` field which is the +application-specific user supplied message and where the type corresponds to the +value defined by the `@type` field. > __Note__: For now, the specification requires that a user is only allowed to sign bytes of [valid](https://github.com/tendermint/tendermint/blob/master/libs/common/string.go#L61-L74) ASCII text. This requires that the `@type` field equals `"message"`. @@ -104,9 +107,23 @@ the [JSON schema](http://json-schema.org/) specification: }, "domain_separator": { "type": "string", - "description": "The application domain separator.", + "description": "The application unique domain separator.", "pattern": "^[\\x20-\\x7E]+$", "minLength": 1 + }, + "nonce": { + "type": "integer", + "description": "The account nonce.", + "minimum": 0 + }, + "block_height": { + "type": "integer", + "description": "The chain block height.", + "minimum": 0 + }, + "timestamp": { + "type": "integer", + "minimum": 0 } }, "required": [ @@ -117,14 +134,6 @@ the [JSON schema](http://json-schema.org/) specification: } ``` -We define the following operations in signing and verifying Cosmos messages: - -TODO: - -#### Replay Protection - -TODO: - ### Backwards Compatibility (discussion of compatibility or lack thereof with previous standards) From 0f93415ba7361a59fedcbda757ea9039a8d8dc4d Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Thu, 7 Mar 2019 16:05:05 -0500 Subject: [PATCH 12/17] Add formulation --- spec/ics-15-cosmos-signed-messages/README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/spec/ics-15-cosmos-signed-messages/README.md b/spec/ics-15-cosmos-signed-messages/README.md index 6d919942f..5aacd9786 100644 --- a/spec/ics-15-cosmos-signed-messages/README.md +++ b/spec/ics-15-cosmos-signed-messages/README.md @@ -40,13 +40,13 @@ pre-image attacks) ### Technical Specification The Cosmos message signing protocol will be parameterized over a secure -cryptographic hash function `H(x) → y` and a public key DSA `S → (sk, pk)`, where +cryptographic hash function `y ← H(x)` and a public key DSA `(sk,pk) ← S`, where `H` satisfies the desired properties such as having resistance to collision and second pre-image attacks, as well as being [deterministic](https://en.wikipedia.org/wiki/Hash_function#Determinism) and [uniform](https://en.wikipedia.org/wiki/Hash_function#Uniformity) and where -`S` contains the operations signsk(x) → y and -verifypk(x, H) → true|false which provide digital +`S` contains the operations signsk(x) → z and +verifypk(x,z,H) → true|false which provide digital signatures over a set of bytes and verification of signatures respectively. Tendermint has a well established protocol for signing messages using a canonical @@ -134,6 +134,10 @@ the [JSON schema](http://json-schema.org/) specification: } ``` +We can formally specify the Cosmos message signing protocol as follows. +Given a message `m` that adheres to the JSON schema defined and `M`, the set of +all possible valid messages: ∀m ∈ M, z ← signsk(H(m)). + ### Backwards Compatibility (discussion of compatibility or lack thereof with previous standards) From 4ddafcc239eb9fca5c596f8d456ff69344e8afa2 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Fri, 8 Mar 2019 15:47:51 -0500 Subject: [PATCH 13/17] Update JSON schema to support strings or objects --- spec/ics-15-cosmos-signed-messages/README.md | 32 ++++++-------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/spec/ics-15-cosmos-signed-messages/README.md b/spec/ics-15-cosmos-signed-messages/README.md index 5aacd9786..3211a8969 100644 --- a/spec/ics-15-cosmos-signed-messages/README.md +++ b/spec/ics-15-cosmos-signed-messages/README.md @@ -59,6 +59,9 @@ For the purposes of signing Cosmos messages, the `@chain_id` field must correspo to the Cosmos chain identifier. The user-agent should **refuse** signing if the `@chain_id` field does not match the currently active chain! The `@type` field corresponds to the type of structure the user will be signing in an application. +The protocol allows for signing valid ASCII text and application-specific objects. +In the former case, the `@type` must be `"message"` and the latter case `@type` +must be `"object"`. Having the ability to support domain separation of messages is also be vital as just simply encoding messages is not sufficient. For example, some applications @@ -70,12 +73,8 @@ client may provide optional replay protection data via the fields `nonce`, Finally, the JSON representation must also include a `data` field which is the application-specific user supplied message and where the type corresponds to the -value defined by the `@type` field. - -> __Note__: For now, the specification requires that a user is only allowed to -sign bytes of [valid](https://github.com/tendermint/tendermint/blob/master/libs/common/string.go#L61-L74) ASCII text. This requires that the `@type` field equals `"message"`. -However, this will change and evolve to support additional application-specific -structures that are human-readable and machine-verifiable (see below). +value defined by the `@type` field. This must be valid ASCII text or +an application-specific object. Thus, we can have a canonical JSON structure for signing Cosmos messages using the [JSON schema](http://json-schema.org/) specification: @@ -94,14 +93,15 @@ the [JSON schema](http://json-schema.org/) specification: }, "@type": { "type": "string", - "description": "The message type. It must be 'message'.", + "description": "The message type.", "enum": [ - "message" + "message", + "object" ] }, "data": { - "type": "string", - "description": "The valid ASCII text to sign.", + "type": ["string", "object"], + "description": "The application message.", "pattern": "^[\\x20-\\x7E]+$", "minLength": 1 }, @@ -138,18 +138,6 @@ We can formally specify the Cosmos message signing protocol as follows. Given a message `m` that adheres to the JSON schema defined and `M`, the set of all possible valid messages: ∀m ∈ M, z ← signsk(H(m)). -### Backwards Compatibility - -(discussion of compatibility or lack thereof with previous standards) - -### Forwards Compatibility - -(discussion of compatibility or lack thereof with expected future standards) - -### Example Implementation - -(link to or description of concrete example implementation) - ## History 2019-03-07: Initial ICS 1 draft finished and submitted as a PR From d38b49447a67c70949dd541314b758b9d836c705 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Fri, 8 Mar 2019 15:48:39 -0500 Subject: [PATCH 14/17] Update headers --- spec/ics-15-cosmos-signed-messages/README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spec/ics-15-cosmos-signed-messages/README.md b/spec/ics-15-cosmos-signed-messages/README.md index 3211a8969..1116cc28a 100644 --- a/spec/ics-15-cosmos-signed-messages/README.md +++ b/spec/ics-15-cosmos-signed-messages/README.md @@ -8,7 +8,7 @@ created: 2019-03-07 modified: 2019-03-07 --- -## Synopsis +# Synopsis Having the ability to sign messages off-chain has proven to be a fundamental aspect of nearly any blockchain. The notion of signing messages off-chain has many @@ -22,9 +22,9 @@ having the ability to sign Cosmos messages with a Ledger or similar HSM device. A standardized protocol for hashing, signing, and verifying messages that can be implemented by the Cosmos SDK and other third-party organizations is needed. -## Specification +# Specification -### Desired Properties +## Desired Properties The Cosmos message signing standardized protocol subscribes to the following: @@ -37,7 +37,7 @@ pre-image attacks) * Have builtin framework and support for domain separation and replay protection * Has protection against potentially signing transactions a user did not intend to -### Technical Specification +## Technical Specification The Cosmos message signing protocol will be parameterized over a secure cryptographic hash function `y ← H(x)` and a public key DSA `(sk,pk) ← S`, where @@ -138,10 +138,10 @@ We can formally specify the Cosmos message signing protocol as follows. Given a message `m` that adheres to the JSON schema defined and `M`, the set of all possible valid messages: ∀m ∈ M, z ← signsk(H(m)). -## History +# History 2019-03-07: Initial ICS 1 draft finished and submitted as a PR -## Copyright +# Copyright Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). \ No newline at end of file From 0aa214e2410f223a1ad9a818af125e1f2aa63701 Mon Sep 17 00:00:00 2001 From: Christopher Goes Date: Wed, 1 May 2019 14:20:08 -0400 Subject: [PATCH 15/17] Update spec/ics-15-cosmos-signed-messages/README.md Co-Authored-By: alexanderbez --- spec/ics-15-cosmos-signed-messages/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/ics-15-cosmos-signed-messages/README.md b/spec/ics-15-cosmos-signed-messages/README.md index 1116cc28a..dfa4d0534 100644 --- a/spec/ics-15-cosmos-signed-messages/README.md +++ b/spec/ics-15-cosmos-signed-messages/README.md @@ -26,7 +26,7 @@ implemented by the Cosmos SDK and other third-party organizations is needed. ## Desired Properties -The Cosmos message signing standardized protocol subscribes to the following: +The Cosmos message signing standardized protocol should fulfill the following requirements: * Use of a secure cryptographic hash function (e.g. resistance to collision and second pre-image attacks) @@ -144,4 +144,4 @@ all possible valid messages: ∀m ∈ M, z ← signsk(H(m)) Date: Wed, 1 May 2019 14:20:26 -0400 Subject: [PATCH 16/17] Update spec/ics-15-cosmos-signed-messages/README.md Co-Authored-By: alexanderbez --- spec/ics-15-cosmos-signed-messages/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/ics-15-cosmos-signed-messages/README.md b/spec/ics-15-cosmos-signed-messages/README.md index dfa4d0534..c97821c49 100644 --- a/spec/ics-15-cosmos-signed-messages/README.md +++ b/spec/ics-15-cosmos-signed-messages/README.md @@ -15,7 +15,7 @@ of nearly any blockchain. The notion of signing messages off-chain has many added benefits such as saving on computational costs and reducing transaction throughput and overhead. Within the context of the Cosmos, some of the major applications of signing such data includes, but is not limited to, providing a -cryptographic secure and verifiable means of proving validator identity and +cryptographically secure and verifiable means of proving validator identity and possibly associating it with some other framework or organization. In addition, having the ability to sign Cosmos messages with a Ledger or similar HSM device. From 8f19f745f619cc410c9535aa01fd927d84b47fea Mon Sep 17 00:00:00 2001 From: Christopher Goes Date: Wed, 1 May 2019 14:20:40 -0400 Subject: [PATCH 17/17] Update spec/ics-15-cosmos-signed-messages/README.md Co-Authored-By: alexanderbez --- spec/ics-15-cosmos-signed-messages/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/ics-15-cosmos-signed-messages/README.md b/spec/ics-15-cosmos-signed-messages/README.md index c97821c49..cbc693925 100644 --- a/spec/ics-15-cosmos-signed-messages/README.md +++ b/spec/ics-15-cosmos-signed-messages/README.md @@ -56,7 +56,7 @@ These meta fields are **reserved** and **must** be included. In addition, the fi must be ordered in lexicographically ascending order. For the purposes of signing Cosmos messages, the `@chain_id` field must correspond -to the Cosmos chain identifier. The user-agent should **refuse** signing if the +to the Cosmos chain identifier, as specified in the root-of-trust or genesis file. The user-agent should **refuse** signing if the `@chain_id` field does not match the currently active chain! The `@type` field corresponds to the type of structure the user will be signing in an application. The protocol allows for signing valid ASCII text and application-specific objects.