|
| 1 | +--- |
| 2 | +Title: RBAC Key Identifier URI Specification |
| 3 | +Category: Catalyst |
| 4 | +Status: Proposed |
| 5 | +Authors: |
| 6 | + - Steven Johnson <[email protected]> |
| 7 | +Implementors: |
| 8 | + - Catalyst Fund 14 |
| 9 | +Discussions: [] |
| 10 | +Created: 2025-01-05 |
| 11 | +License: CC-BY-4.0 |
| 12 | +--- |
| 13 | + |
| 14 | +* [Abstract](#abstract) |
| 15 | +* [Motivation: why is this CIP necessary?](#motivation-why-is-this-cip-necessary) |
| 16 | +* [Specification](#specification) |
| 17 | + * [URI](#uri) |
| 18 | + * [`scheme`](#scheme) |
| 19 | + * [`authority`](#authority) |
| 20 | + * [`authority` - `host`](#authority---host) |
| 21 | + * [List of defined hosts](#list-of-defined-hosts) |
| 22 | + * [`authority` - `userinfo`](#authority---userinfo) |
| 23 | + * [Lists of defined subnetwork `userinfo` values](#lists-of-defined-subnetwork-userinfo-values) |
| 24 | + * [Cardano](#cardano) |
| 25 | + * [`path`](#path) |
| 26 | +* [Reference Implementation](#reference-implementation) |
| 27 | +* [Test Vectors](#test-vectors) |
| 28 | +* [Rationale: how does this CIP achieve its goals?](#rationale-how-does-this-cip-achieve-its-goals) |
| 29 | +* [Path to Active](#path-to-active) |
| 30 | + * [Acceptance Criteria](#acceptance-criteria) |
| 31 | + * [Implementation Plan](#implementation-plan) |
| 32 | +* [Copyright](#copyright) |
| 33 | + |
| 34 | +## Abstract |
| 35 | + |
| 36 | +Definition of a [URI] which allows for RBAC keys used for different purposes to be easily and |
| 37 | +unambiguously identified. |
| 38 | + |
| 39 | +## Motivation: why is this CIP necessary? |
| 40 | + |
| 41 | +There is a need to identify which Key from a RBAC registration was used to sign data. |
| 42 | +RBAC defines a universal keychain of different keys that can be used for different purposes. |
| 43 | +They can be used not only for Signatures, but also Encryption. |
| 44 | + |
| 45 | +Therefore, there needs to be an unambiguous and easy to lookup identifier to signify which key was |
| 46 | +used for a particular purpose. |
| 47 | + |
| 48 | +This document defines a [URI] scheme to unambiguously define a particular key with reference to a |
| 49 | +particular RBAC keychain. |
| 50 | + |
| 51 | +## Specification |
| 52 | + |
| 53 | +### URI |
| 54 | + |
| 55 | +The RBAC Kid is formatted using a [Universal Resource Identifier]. |
| 56 | +Refer to [RFC3986] for the specification of the URI format. |
| 57 | + |
| 58 | +### `scheme` |
| 59 | + |
| 60 | +The [scheme](https://datatracker.ietf.org/doc/html/rfc3986#section-3.1) **MUST** be `kid.catalyst-rbac`; |
| 61 | + |
| 62 | +### `authority` |
| 63 | + |
| 64 | +The [authority](https://datatracker.ietf.org/doc/html/rfc3986#section-3.2) references the blockchain or network |
| 65 | +the key was registered within. |
| 66 | + |
| 67 | +It is perfectly valid for a Kid to reference a different network than the place where the Key is used. |
| 68 | +For example, a `cardano` KID can be used to post documents to `IPFS`. |
| 69 | +Its purpose is to define WHERE the key was registered, and nothing more. |
| 70 | + |
| 71 | +The Authority will consist of a `host` and optional `userinfo`. |
| 72 | + |
| 73 | +#### `authority` - `host` |
| 74 | + |
| 75 | +The [host](https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2) |
| 76 | +refers to the network type where the RBAC registration was made. |
| 77 | +It **IS NOT** resolvable with **DNS**, and **IS NOT** a public host name. |
| 78 | +It is used as a decentralized network identifier. |
| 79 | +The consumer of the `KID` must be able to resolve these host names. |
| 80 | + |
| 81 | +##### List of defined hosts |
| 82 | + |
| 83 | +| `host` | Description | |
| 84 | +| --- | --- | |
| 85 | +| `cardano` | Cardano Blockchain | |
| 86 | +| `midnight` | Midnight Blockchain | |
| 87 | +| `ethereum` | Ethereum Blockchain | |
| 88 | +| `cosmos` | Cosmos Blockchain | |
| 89 | + |
| 90 | +#### `authority` - `userinfo` |
| 91 | + |
| 92 | +The [userinfo](https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1) |
| 93 | +is used to distinguish a subnetwork from the primary main network. |
| 94 | +The absence of `userinfo` is used to indicate the primary main network. |
| 95 | + |
| 96 | +##### Lists of defined subnetwork `userinfo` values |
| 97 | + |
| 98 | +###### Cardano |
| 99 | + |
| 100 | +| `userinfo` | Description | |
| 101 | +| --- | --- | |
| 102 | +| `preprod` | Cardano Pre-Production Network | |
| 103 | +| `preview` | Cardano Preview Network | |
| 104 | +| 0x<hex_number> | Cardano network identified by this magic number in hex | |
| 105 | + |
| 106 | +### `path` |
| 107 | + |
| 108 | +The [path](https://datatracker.ietf.org/doc/html/rfc3986#section-3.3) defines the actual key within the registration. |
| 109 | +Keys are defined relative to the very first Role0 Key registered in any RBAC registration. |
| 110 | + |
| 111 | +The overall `path` specification is: `<initial role0 key>/<role>/<rotation>#encrypt` |
| 112 | + |
| 113 | +* `<initial role 0 key>` - This is the very first role 0 key used to post the registration to the network. |
| 114 | + * It is the [Base64 URL] encoded binary data of the role 0 public key. |
| 115 | + * This does not change, even if the Initial Role 0 key is revoked. |
| 116 | + * This allows for an unambiguous identifier for the RBAC keychain. |
| 117 | + * It is not necessarily the key being identified. |
| 118 | +* `<role>` - This is the Role number being used. |
| 119 | + * It is a positive number, starting at 0, and no greater than 65535. |
| 120 | +* `<rotation>` - This is the rotation of the defined role key being identified. |
| 121 | + * It starts at 0 for the first published key for the role, and increments by one for each subsequent published rotation. |
| 122 | + * This number refers to the published sequence of keys for the role in the RBAC registration keychain, |
| 123 | + not the index used in the key derivation. |
| 124 | + * It is positive and no greater than 65535. |
| 125 | +* `#encrypt` - [Fragment](https://datatracker.ietf.org/doc/html/rfc3986#section-3.5) |
| 126 | + disambiguates Encryption Public Keys from signing public keys. |
| 127 | + * Roles can have 1 active public signing key, and 1 active public encryption key. |
| 128 | + * By default, the URL is referencing the signing public key. |
| 129 | + * If a public encryption key is being identified, then the fragment `#encrypt` is appended to the [Universal Resource Identifier]. |
| 130 | + |
| 131 | +## Reference Implementation |
| 132 | + |
| 133 | +The first implementation will be Catalyst Voices. |
| 134 | + |
| 135 | +## Test Vectors |
| 136 | + |
| 137 | +* `kid.catalyst-rbac://cardano/<key>/0/0` |
| 138 | + * A Signing key registered on the Cardano Main network. |
| 139 | + * Role 0 - Rotation 0. |
| 140 | + In this example, it is exactly the same as the `<key>`. |
| 141 | +* `kid.catalyst-rbac://preprod@cardano/<key>/7/3` |
| 142 | + * A Signing key registered on the Cardano pre-production network. |
| 143 | + * Role 7 - Rotation 3. |
| 144 | + The Key for Role 7, and its third published rotation |
| 145 | + (i.e., the fourth key published, the first is the initial key, plus 3 rotations following it). |
| 146 | +* `kid.catalyst-rbac://preprod@cardano/<key>/2/0#encrypt` |
| 147 | + * A Public Encryption key registered on the Cardano pre-production network. |
| 148 | + * Role 2 - Rotation 0. |
| 149 | + The initially published Public Encryption Key for Role 2. |
| 150 | +* `kid.catalyst-rbac://midnight/<key>/0/1` |
| 151 | + * A Signing key registered on the Midnight Blockchain Main network |
| 152 | + * Role 0 - Rotation 1. |
| 153 | + In this example, it is NOT the same as the `<key>`, as it identifies the first rotation after `<key>`. |
| 154 | +* `kid.catalyst-rbac://midnight/<key>/2/1#encrypt` |
| 155 | + * A public encryption key registered on the Midnight Blockchain Main network. |
| 156 | + * Role 2 - Rotation 1. |
| 157 | + |
| 158 | +## Rationale: how does this CIP achieve its goals? |
| 159 | + |
| 160 | +By creating a [URI] to identify keys, |
| 161 | +we allow the unambiguous and flexible identification of any RBAC Key that was used for any purpose. |
| 162 | + |
| 163 | +## Path to Active |
| 164 | + |
| 165 | +### Acceptance Criteria |
| 166 | + |
| 167 | +Working Implementation before Fund 14. |
| 168 | + |
| 169 | +### Implementation Plan |
| 170 | + |
| 171 | +Fund 14 project catalyst will deploy this scheme for Key Identification. |
| 172 | + |
| 173 | +## Copyright |
| 174 | + |
| 175 | +This document is licensed under [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/legalcode). |
| 176 | + |
| 177 | +[URI]: https://datatracker.ietf.org/doc/html/rfc3986 |
| 178 | +[Universal Resource Identifier]: https://datatracker.ietf.org/doc/html/rfc3986 |
| 179 | +[RFC3986]: https://datatracker.ietf.org/doc/html/rfc3986 |
| 180 | +[Base64 URL]: https://datatracker.ietf.org/doc/html/rfc4648#section-5 |
0 commit comments