Skip to content

Add Canton Namespace - #201

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

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

Conversation

@mjuchli-da

@mjuchli-da mjuchli-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 thread canton/caip2.md Outdated
Comment thread canton/caip2.md
Comment thread canton/caip19.md
Comment thread canton/caip19.md Outdated
Comment thread canton/caip19.md
Comment thread canton/caip19.md Outdated
Comment thread canton/caip19.md Outdated
Comment thread canton/caip19.md Outdated
Comment thread canton/caip19.md
Comment thread canton/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_reference https://github.com/ChainAgnostic/namespaces/blob/main/stacks/caip19.md

@amunchhansen amunchhansen 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 thread canton/caip19.md Outdated
Comment thread canton/caip19.md Outdated
Comment thread canton/caip19.md

For Example:
```
canton:mainnet-global/cip-56:decentralized-usdc-interchain-rep%3A%3A12208115f1e168dd7e792320be9c4ca720c751a02a3053c7606e1c1cd3dad9bf60ef/USDCx

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The separator is . and not /

Comment thread canton/caip19.md

```
asset_namespace = cip-56
asset_reference = percentEncode({instrumentId.admin}) + "." + percentEncode({instrumentId.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.

I think a brief description of percentEncode might be appropriate (for instance, what exactly gets encoded? Now at least these . and : are required)

Comment thread canton/caip19.md
asset_type = {chain_id}/slip44:6767
```

Hence, for `CC` on `canton:mainnet-global`, the `asset_type` is `canton:mainnet/slip44:6767`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is it mainnet or mainnet-global? The CAIP2 defines it as mainnet-global.

Comment thread canton/caip2.md
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}`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Technically it's at most 25 characters in that case, since devnet is shorter than the others?

Comment thread canton/caip10.md

## 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}`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread canton/caip10.md

Examples:
```
canton:mainnet-global:alice%3A%3A123abc...

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 consider using the prefix 1220 for both examples, it's weird having one with and one without

Comment thread canton/caip10.md

## 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}`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Lenght -> Length

@amunchhansen amunchhansen 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 additional comments

Sign up for free to 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