Add Canton Namespace - #201
Conversation
d8c1441 to
ec44285
Compare
ec44285 to
d0c32f5
Compare
| - [Canton CAIP-2](./caip2.md): Canton chain identifier profile | ||
| - [CIP-0056](https://github.com/canton-foundation/cips/blob/main/cip-0056/cip-0056): Canton token standard | ||
| - [SLIP-44](https://github.com/satoshilabs/slips/blob/master/slip-0044.md): Registered coin types | ||
|
|
There was a problem hiding this comment.
There exists a precedent for using a compound asset_reference https://github.com/ChainAgnostic/namespaces/blob/main/stacks/caip19.md
4188500 to
cb9010b
Compare
|
|
||
| For Example: | ||
| ``` | ||
| canton:mainnet-global/cip-56:decentralized-usdc-interchain-rep%3A%3A12208115f1e168dd7e792320be9c4ca720c751a02a3053c7606e1c1cd3dad9bf60ef/USDCx |
|
|
||
| ``` | ||
| asset_namespace = cip-56 | ||
| asset_reference = percentEncode({instrumentId.admin}) + "." + percentEncode({instrumentId.id}) |
There was a problem hiding this comment.
I think a brief description of percentEncode might be appropriate (for instance, what exactly gets encoded? Now at least these . and : are required)
| asset_type = {chain_id}/slip44:6767 | ||
| ``` | ||
|
|
||
| Hence, for `CC` on `canton:mainnet-global`, the `asset_type` is `canton:mainnet/slip44:6767`. |
There was a problem hiding this comment.
Is it mainnet or mainnet-global? The CAIP2 defines it as mainnet-global.
| canton:{mainnet|testnet|devnet}-dedicated-name | ||
| ``` | ||
|
|
||
| The complete network identifier, prefix and dedicated name together, **MUST** satisfy the CAIP-2 reference production `[-_a-zA-Z0-9]{1,32}`, leaving at most 24 characters for `{dedicated-name}`. |
There was a problem hiding this comment.
Technically it's at most 25 characters in that case, since devnet is shorter than the others?
|
|
||
| ## Limitations | ||
|
|
||
| The `account_address` lenght **MUST** be <= 128 characters. The party namespace takes 64 characters, the url encoded colons 4 characters, the `canton:` prefix 7 characters, and thus leaving 53 characters for the `{networkIdentifier}:{partyHint}`. |
There was a problem hiding this comment.
Wouldn't it be percent encoded colons and it's 6 characters, not 4.
Isn't the party namespace 68 characters because of the prefix?
Also, some of the arithmetics seem confusing here, I'm not sure it's 32 characters for the party hint, but I haven't done the math.
|
|
||
| Examples: | ||
| ``` | ||
| canton:mainnet-global:alice%3A%3A123abc... |
There was a problem hiding this comment.
I would consider using the prefix 1220 for both examples, it's weird having one with and one without
|
|
||
| ## Limitations | ||
|
|
||
| The `account_address` lenght **MUST** be <= 128 characters. The party namespace takes 64 characters, the url encoded colons 4 characters, the `canton:` prefix 7 characters, and thus leaving 53 characters for the `{networkIdentifier}:{partyHint}`. |
This PR adds a new
cantonnamespace for the Canton Network.It includes specifications for CAIP2, CAIP10, and CAIP19.