|
| 1 | +--- |
| 2 | +namespace-identifier: keeta-caip10 |
| 3 | +title: Keeta - Account ID Specification |
| 4 | +author: ["@sc4l3r", "@xescure"] |
| 5 | +discussions-to: https://github.com/ChainAgnostic/namespaces/pull/183 |
| 6 | +status: Draft |
| 7 | +type: Standard |
| 8 | +created: 2026-04-27 |
| 9 | +requires: ["CAIP-2", "CAIP-10"] |
| 10 | +--- |
| 11 | + |
| 12 | +# CAIP-10 |
| 13 | + |
| 14 | +_For context, see the [CAIP-10][] specification._ |
| 15 | + |
| 16 | +## Introduction |
| 17 | + |
| 18 | +Every [account][accounts] on a Keeta network -- whether it is a key-pair-backed account (ECDSA secp256k1/r1, or Ed25519), a token, a storage account, a network account, or a multisig -- is addressed from a single shared address space. |
| 19 | +A **keyed account** holds a private key and signs its own blocks. |
| 20 | +A **generated account**, also called an identifier account -- a token, storage account, network account, or multisig -- has no private key, and its blocks are signed by a keyed account holding permission over it. |
| 21 | +A Keeta address is the account's public key itself with a type byte and a five-byte checksum, all of which is then encoded as base32. |
| 22 | +The address alone reveals the account type and signature algorithm. |
| 23 | + |
| 24 | +The same key pair produces the same address on every Keeta network, but account state is per network, so `keeta:21378:<address>` and `keeta:1413829460:<address>` are different accounts. |
| 25 | +Generated accounts exist only on the network where they were created (see [Semantics](#semantics)). |
| 26 | + |
| 27 | +Keeta renders every address with the display prefix `keeta_`. |
| 28 | +This profile uses the **bare base32 body**, without the prefix, as the [CAIP-10][] `account_address`. |
| 29 | + |
| 30 | +## Specification |
| 31 | + |
| 32 | +### Semantics |
| 33 | + |
| 34 | +The inputs are: |
| 35 | + |
| 36 | +- A Keeta network identifier, as defined in the [Keeta CAIP-2 Profile][CAIP-2 Profile], identifying which network the account lives on. |
| 37 | +- A Keeta address as rendered by the SDK, `keeta_<body>`, returned by `account.publicKeyString.toString()` and accepted by `Account.fromPublicKeyString()`. |
| 38 | + |
| 39 | +Only the body is used; the display prefix is discarded (see [Syntax](#syntax)). |
| 40 | + |
| 41 | +The body is the [RFC 4648][rfc4648] base32 encoding, lowercase and without padding, of the following byte sequence: |
| 42 | + |
| 43 | +``` |
| 44 | +type || key || SHA3-256(type || key)[0..5] |
| 45 | +``` |
| 46 | + |
| 47 | +- `type` is one byte identifying the account kind: `0` ECDSA secp256k1, `1` Ed25519, `2` network account, `3` token, `4` storage account, `6` ECDSA secp256r1, `7` multisig; the value `5` is unassigned. |
| 48 | +- `key` is the 33-byte compressed public key for ECDSA accounts, the 32-byte public key for Ed25519 accounts, or a 32-byte identifier for generated accounts. |
| 49 | +- The last five bytes are a checksum over the preceding bytes. |
| 50 | + |
| 51 | +As of `keetanet-client` version `0.18.4` the body is 63 characters for ECDSA accounts and 61 characters for all others. |
| 52 | +Keeta may introduce further signing algorithms; the SDK is the authoritative source for the set of type bytes and for encoding and decoding (see [Resolution Mechanics](#resolution-mechanics)). |
| 53 | + |
| 54 | +A keyed address is a valid recipient on any Keeta network before any block has been published to its chain. |
| 55 | +A generated account is created by a [`CREATE_IDENTIFIER` operation][generate-identifier], and its identifier is derived from the creating account, the hash of the creating account's previous block on that network, and the index of the operation within that block. |
| 56 | +The network account is derived from the network identifier alone, and the base token from the network account. |
| 57 | + |
| 58 | +#### Canonicalization |
| 59 | + |
| 60 | +A Keeta address is **case-insensitive**: per RFC 4648, two base32-encoded bodies that differ only in letter case decode to the same byte sequence and therefore identify the same account. |
| 61 | +For [CAIP-10][] purposes the canonical form is **all-lowercase**, and producers MUST lowercase the body before emitting a CAIP-10 string. |
| 62 | +An uppercase or mixed-case body does not match the syntax in this profile; consumers MAY accept one by lowercasing it before validation, in which case the lowercased form identifies the same account and SHOULD be the form used as a cache or lookup key. |
| 63 | + |
| 64 | +### Syntax |
| 65 | + |
| 66 | +A Keeta [CAIP-10][] account identifier MUST take the form: |
| 67 | + |
| 68 | +``` |
| 69 | +keeta:<network>:<address> |
| 70 | +``` |
| 71 | + |
| 72 | +Where: |
| 73 | + |
| 74 | +- `keeta` is the namespace. |
| 75 | +- `<network>` is a Keeta network identifier as defined by the [Keeta CAIP-2 Profile][CAIP-2 Profile]. |
| 76 | +- `<address>` is the body of the Keeta public key string, **without** the `keeta_` display prefix, in lowercase. |
| 77 | + |
| 78 | +To produce `<address>` from an address as rendered by the SDK, remove the display prefix up to and including the `_` and lowercase the remainder. |
| 79 | +To pass `<address>` to the SDK, prepend `keeta_`. |
| 80 | + |
| 81 | +The `<address>` segment MUST match: |
| 82 | + |
| 83 | +``` |
| 84 | +^[a-z2-7]+$ |
| 85 | +``` |
| 86 | + |
| 87 | +A regex match is necessary but not sufficient for checking address validity as it does not verify the type byte, the checksum, or the length. |
| 88 | +Implementations MUST validate addresses using the Keeta SDK or by following the steps in [Resolution Mechanics](#resolution-mechanics). |
| 89 | + |
| 90 | +### Resolution Mechanics |
| 91 | + |
| 92 | +To validate a Keeta CAIP-10 identifier: |
| 93 | + |
| 94 | +1. Split on `:` and verify the namespace is `keeta`. |
| 95 | +2. Validate `<network>` against the [Keeta CAIP-2 Profile][CAIP-2 Profile]. |
| 96 | +3. Lowercase `<address>` to obtain its canonical form; see [Canonicalization](#canonicalization). |
| 97 | +4. Prepend `keeta_` and decode the result using the Keeta public-key-string codec; verify the type byte and checksum. |
| 98 | +5. Optionally, query a node on the indicated network to confirm the account exists and to retrieve its info: |
| 99 | + |
| 100 | +```ts |
| 101 | +import * as KeetaNet from "@keetanetwork/keetanet-client"; |
| 102 | + |
| 103 | +const address = "aabfo65nbz4toez4ouzit3ej5elpcjnatv6p6vxtgj5gj4x4cbs3nkytnpniyhi"; |
| 104 | +const account = KeetaNet.lib.Account.fromPublicKeyString(`keeta_${address}`); |
| 105 | +const client = KeetaNet.Client.fromNetwork("test"); |
| 106 | +const { info } = await client.getAccountInfo(account); |
| 107 | +``` |
| 108 | + |
| 109 | +Implementations SHOULD validate the checksum by round-tripping through `Account.fromPublicKeyString()` before treating the identifier as well-formed. |
| 110 | + |
| 111 | +Implementations SHOULD use the methods of a Keeta SDK (e.g. `account.isToken()`, `account.isStorage()`) to determine the type of an account. |
| 112 | + |
| 113 | +Note that account _existence_ is not required for a CAIP-10 string to be valid; a keyed address may be a valid recipient before any block has been published to its chain (see [Semantics](#semantics)). |
| 114 | + |
| 115 | +## Rationale |
| 116 | + |
| 117 | +The `keeta_` prefix is omitted because `_` is not a permitted character in a [CAIP-10][] `account_address`, and because the `keeta:` namespace segment already identifies the ecosystem. |
| 118 | +The prefix is not part of the encoded bytes or the checksum, so the body alone identifies the account. |
| 119 | + |
| 120 | +The resulting form fits comfortably within the [CAIP-10][] `account_address` length budget of 128 characters: the body is currently 63 characters for compressed ECDSA secp256k1/r1 keys and 61 characters for Ed25519 and generated accounts. |
| 121 | +The syntax does not fix these lengths, so a signing algorithm added to Keeta is usable under this profile as soon as the SDK supports it; only implementations that handle accounts of the new kind need to update. |
| 122 | + |
| 123 | +### Backwards Compatibility |
| 124 | + |
| 125 | +This is the first [CAIP-10][] specification for the `keeta` namespace, so there are no legacy identifiers to support. |
| 126 | + |
| 127 | +## Test Cases |
| 128 | + |
| 129 | +Valid (test network, `1413829460`): |
| 130 | + |
| 131 | +``` |
| 132 | +# Keyed secp256k1 account |
| 133 | +keeta:1413829460:aabfo65nbz4toez4ouzit3ej5elpcjnatv6p6vxtgj5gj4x4cbs3nkytnpniyhi |
| 134 | +``` |
| 135 | + |
| 136 | +Valid forms on other networks: |
| 137 | + |
| 138 | +``` |
| 139 | +# Main network, keyed Ed25519 account |
| 140 | +keeta:21378:ae23cu2wimbyuvib6p77aw7zchgjmfia3fauuhy6mh44xa57buokkhifpsnxo |
| 141 | +
|
| 142 | +# Main network, keyed secp256r1 account |
| 143 | +keeta:21378:aybzhzcxweiencq2glio3sj6rs5g2sb7qcgmvrumi2y3dmt4sqqvg2zders2ggy |
| 144 | +
|
| 145 | +# Main network, token account |
| 146 | +keeta:21378:anqdilpazdekdu4acw65fj7smltcp26wbrildkqtszqvverljpwpezmd44ssg |
| 147 | +
|
| 148 | +# Main network, storage account |
| 149 | +keeta:21378:aqltdal4rshtky5iehd765y3mdjkcmku5d4ulo5fgonzqrxulwepnogq33mle |
| 150 | +
|
| 151 | +# Main network, network account |
| 152 | +keeta:21378:alwerxoezkupzhifvpo5yvoazlsdqaweov66mokhq7xl4h5ow36v5xu6ek3js |
| 153 | +
|
| 154 | +# Main network, multisig account |
| 155 | +keeta:21378:a6wiuzcmz4lx3tenp5p24gs76epchg5i22xdkz4r3egopog47onnhhokvqjam |
| 156 | +``` |
| 157 | + |
| 158 | +Non-conformant but recoverable (does not match the syntax; a consumer MAY lowercase it, after which it identifies the same account as the lowercase form; see [Canonicalization](#canonicalization)): |
| 159 | + |
| 160 | +``` |
| 161 | +# Uppercase body |
| 162 | +keeta:21378:AE23CU2WIMBYUVIB6P77AW7ZCHGJMFIA3FAUUHY6MH44XA57BUOKKHIFPSNXO |
| 163 | +``` |
| 164 | + |
| 165 | +Invalid: |
| 166 | + |
| 167 | +``` |
| 168 | +# Display prefix included in the address |
| 169 | +keeta:21378:keeta_ae23cu2wimbyuvib6p77aw7zchgjmfia3fauuhy6mh44xa57buokkhifpsnxo |
| 170 | +
|
| 171 | +# Wrong namespace casing |
| 172 | +Keeta:21378:ae23cu2wimbyuvib6p77aw7zchgjmfia3fauuhy6mh44xa57buokkhifpsnxo |
| 173 | +
|
| 174 | +# Hex network identifier (see Keeta CAIP-2 Profile) |
| 175 | +keeta:0x5382:ae23cu2wimbyuvib6p77aw7zchgjmfia3fauuhy6mh44xa57buokkhifpsnxo |
| 176 | +
|
| 177 | +# Invalid checksum (last character altered) |
| 178 | +keeta:21378:ae23cu2wimbyuvib6p77aw7zchgjmfia3fauuhy6mh44xa57buokkhifpsnxa |
| 179 | +
|
| 180 | +# Wrong length (one character dropped) |
| 181 | +keeta:21378:ae23cu2wimbyuvib6p77aw7zchgjmfia3fauuhy6mh44xa57buokkhifpsnx |
| 182 | +``` |
| 183 | + |
| 184 | +## Additional Considerations |
| 185 | + |
| 186 | +### Account type prefixes |
| 187 | + |
| 188 | +The type byte occupies the high bits of the encoded body, so the first two characters of the body reflect the account kind. |
| 189 | +As of `keetanet-client` version `0.18.4`: |
| 190 | + |
| 191 | +| First two characters | Account type | |
| 192 | +| :--------------------- | :------------------------------- | |
| 193 | +| `aa`, `ab`, `ac`, `ad` | Keyed account, ECDSA secp256k1 | |
| 194 | +| `ae`, `af`, `ag`, `ah` | Keyed account, Ed25519 | |
| 195 | +| `ay`, `az`, `a2`, `a3` | Keyed account, ECDSA secp256r1 | |
| 196 | +| `ai`, `aj`, `ak`, `al` | Network account | |
| 197 | +| `am`, `an`, `ao`, `ap` | Token account | |
| 198 | +| `aq`, `ar`, `as`, `at` | Storage account | |
| 199 | +| `a4`, `a5`, `a6`, `a7` | Multisig account | |
| 200 | + |
| 201 | +This table is illustrative and is **not** normative for type discrimination. |
| 202 | +Implementations MUST NOT switch on these prefixes to determine an account's type; instead, parse the address with a Keeta SDK and use `account.isToken()`, `account.isStorage()`, `account.isNetwork()`, and `account.isMultisig()`. |
| 203 | + |
| 204 | +### Security |
| 205 | + |
| 206 | +Keeta addresses encode their type and end in a checksum, so single-character typos and accidental cross-pasting between account types (e.g. sending to a token address instead of a keyed account) are detectable on the client side without a network round-trip. |
| 207 | +Implementations SHOULD perform this check before signing a transaction that references a counterparty CAIP-10. |
| 208 | + |
| 209 | +## References |
| 210 | + |
| 211 | +- Keeta [accounts] - account types, generated accounts, and address derivation. |
| 212 | +- Keeta [digital signatures][signatures] - the signing algorithms supported by the network. |
| 213 | +- Keeta [SDK package][sdk] - `lib/account.d.ts` declares the type bytes and the `PublicKeyString` codec; the reference for encoding and decoding. |
| 214 | +- [Keeta CAIP-2 Profile][CAIP-2 Profile] - the network portion of the identifier. |
| 215 | +- [RFC 4648][rfc4648] - the base32 alphabet used for the address body. |
| 216 | + |
| 217 | +[CAIP-2 Profile]: ./caip2.md |
| 218 | +[accounts]: https://docs.keeta.com/components/accounts |
| 219 | +[signatures]: https://docs.keeta.com/security/digital-signatures |
| 220 | +[generate-identifier]: https://docs.keeta.com/components/blocks/operations/generateidentifier |
| 221 | +[sdk]: https://www.npmjs.com/package/@keetanetwork/keetanet-client |
| 222 | +[rfc4648]: https://datatracker.ietf.org/doc/html/rfc4648 |
| 223 | +[CAIP-2]: https://chainagnostic.org/CAIPs/caip-2 |
| 224 | +[CAIP-10]: https://chainagnostic.org/CAIPs/caip-10 |
| 225 | + |
| 226 | +## Copyright |
| 227 | + |
| 228 | +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). |
0 commit comments