Skip to content

Add Canton Namespace - #201

Open
mjuchli-da wants to merge 4 commits into
ChainAgnostic:mainfrom
mjuchli-da:feat/add-canton
Open

Add Canton Namespace#201
mjuchli-da wants to merge 4 commits into
ChainAgnostic:mainfrom
mjuchli-da:feat/add-canton

Conversation

@mjuchli-da

@mjuchli-damjuchli-da commented Aug 23, 2026

Copy link
Copy Markdown

This PR adds a new canton namespace for the Canton Network.

It includes specifications for CAIP2, CAIP10, and CAIP19.

@mjuchli-da
mjuchli-da marked this pull request as ready for review August 24, 2026 08:20
Comment threadcanton/caip2.md
Aliases for dedicated synchronizers **MAY** be proposed and **SHOULD** be prefixed with the corresponding network:

```
canton:{mainnet|testnet|devnet}/dedicated-name

@amunchhansenamunchhansenAug 25, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using - instead as a separator. Using - as the separator keeps the identifier free of /, which CAIP-19 reserves as its own separator.

Comment threadcanton/caip2.md
```
canton:{mainnet|testnet|devnet}/dedicated-name
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment threadcanton/caip19.md
- `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}`)

@amunchhansenamunchhansenAug 25, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment threadcanton/caip19.md

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be {networkIdentifier}

Comment threadcanton/caip19.md


### Assets without SLIP-44

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment threadcanton/caip19.md
```
chain_id = canton:{synchronizer} // see CAIP-2
asset_namespace = cip-56
asset_reference = percentEncode({instrumentId.admin})

@amunchhansenamunchhansenAug 25, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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})

Comment threadcanton/caip19.md
asset_reference = percentEncode({instrumentId.admin})
token_id = percentEncode({instrumentId.id})

asset_type = canton:mainnet/cip-56:{instrumentId.admin}/{token_id}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{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}

Comment threadcanton/caip19.md
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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment threadcanton/caip19.md
```

**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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment threadcanton/caip19.md
- [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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There exists a precedent for using a compound asset_referencehttps://github.com/ChainAgnostic/namespaces/blob/main/stacks/caip19.md

@amunchhansenamunchhansen left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added suggestions and comments

Comment threadcanton/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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are not defining networkIdentifier here.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@mjuchli-da@amunchhansen