Uh oh!
There was an error while loading. Please reload this page.
Add Canton Namespace - #201
Conversation
| Aliases for dedicated synchronizers **MAY** be proposed and **SHOULD** be prefixed with the corresponding network: | ||
| ``` | ||
| canton:{mainnet|testnet|devnet}/dedicated-name |
There was a problem hiding this comment.
Consider using - instead as a separator. Using - as the separator keeps the identifier free of /, which CAIP-19 reserves as its own separator.
| ``` | ||
| canton:{mainnet|testnet|devnet}/dedicated-name | ||
| ``` | ||
There was a problem hiding this comment.
Add this explanation of using -:
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}. Using - as the separator keeps the identifier free of /, which CAIP-19 reserves as its own component delimiter.
| - `asset_namespace` identifies the asset identification scheme (`[-a-z0-9]{3,8}`) | ||
| - `asset_reference` identifies the asset within that scheme (`[-.%a-zA-Z0-9]{1,128}`) | ||
| - `token_id`: Optional asset identifer (`[-.%a-zA-Z0-9]{1,78}`) | ||
There was a problem hiding this comment.
I would remove the "optional" token_id here. If it's present, the result is an asset_id, so you'd ordinarily be left with an asset_type only containing the admin, which is not useful. If you do not consider that the way forward, I think it instead merits some kind of explanation of token_id:
Where a token_id is present, the asset id follows asset_type + "/" + token_id.
| For CIP-0056 assets without a SLIP-44 coin type leveraging optional Asset ID (identified by `token_id` for fungibles): | ||
| ``` | ||
| chain_id = canton:{synchronizer} // see CAIP-2 |
d8c1441 to
ec44285Compareec44285 to
d0c32f5Compare| ### Assets without SLIP-44 | ||
There was a problem hiding this comment.
I think some further explanation is required here:
CIP-0056 identifies an instrument by an InstrumentId, comprising an administrating party (admin) and an instrument identifier (id). Both components are required to identify the instrument: a single administrator MAY administer multiple instruments, so admin alone does not identify an asset. The asset_reference therefore combines the two.
| ``` | ||
| chain_id = canton:{synchronizer} // see CAIP-2 | ||
| asset_namespace = cip-56 | ||
| asset_reference = percentEncode({instrumentId.admin}) |
There was a problem hiding this comment.
Alter to, according to the above description (I have no strong feelings towards any splitter, I just picked "."):
asset_reference = percentEncode({instrumentId.admin}) + "." + percentEncode({instrumentId.id})
| asset_reference = percentEncode({instrumentId.admin}) | ||
| token_id = percentEncode({instrumentId.id}) | ||
| asset_type = canton:mainnet/cip-56:{instrumentId.admin}/{token_id} |
There was a problem hiding this comment.
{instrumentId.admin} -> {asset_reference}
{mainnet} -> {networkIdentifier}
Also, as per the caip19 specification, appending a token_id makes it an asset_id instead of an asset_type, so I've suggested changes above to clarify this issue.
The final asset_type becomes:
asset_type = canton:{networkIdentifier}/cip-56:{asset_reference}
| canton:mainnet/cip-56:decentralized-usdc-interchain-rep%3A%3A12208115f1e168dd7e792320be9c4ca720c751a02a3053c7606e1c1cd3dad9bf60ef/USDCx | ||
| ``` | ||
| **Note:** CAIP-19 defines a maximum length of 78 characters for the optional `token_id` component. The compatibility of this mapping depends on the serialized length of the corresponding Canton `instrumentId.id` value after any required encoding. Implementations **MUST** ensure that the resulting token_id complies with the CAIP-19 length constraint. |
There was a problem hiding this comment.
We'll have to change the note accordingly:
Note: CAIP-19 defines a maximum length of 128 characters for the asset_reference component. A Canton party identifier of the form {hint}::{fingerprint} consumes 68 characters for the fingerprint and a further 6 for the percent-encoded ::, and the delimiter consumes 1, leaving 53 characters to be shared between the administrator's party hint and the percent-encoded instrument identifier. Implementations MUST ensure that the resulting asset_reference complies with the CAIP-19 length constraint.
| ``` | ||
| **Note:** CAIP-19 defines a maximum length of 78 characters for the optional `token_id` component. The compatibility of this mapping depends on the serialized length of the corresponding Canton `instrumentId.id` value after any required encoding. Implementations **MUST** ensure that the resulting token_id complies with the CAIP-19 length constraint. | ||
There was a problem hiding this comment.
An additional note explaining the lack of a token_id:
Note: The optional CAIP-19 token_id component is not used by cip-56, as both InstrumentId components identify an instrument rather than an individual unit of it. Should a per-unit identifier become necessary, token_id remains available for that purpose, in which case an asset_id follows asset_type + "/" + token_id.
| - [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_referencehttps://github.com/ChainAgnostic/namespaces/blob/main/stacks/caip19.md
| For assets with a SLIP-44 registered coin type, such as `CC` with `6767`, the format is: | ||
| ``` | ||
| chain_id = canton:{networkIdentifier} // CAIP-2 |
There was a problem hiding this comment.
You are not defining networkIdentifier here.
This PR adds a new
cantonnamespace for the Canton Network.It includes specifications for CAIP2, CAIP10, and CAIP19.