Skip to content

Commit 46e0712

Browse files
authored
Add sui namespace and CAIP-2 spec (#146)
2 parents 1160b41 + d430a98 commit 46e0712

File tree

2 files changed

+169
-0
lines changed

2 files changed

+169
-0
lines changed

sui/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
namespace-identifier: sui
3+
title: Sui Ecosystem
4+
author: William Robertson (@williamrobertson13)
5+
discussions-to: https://github.com/ChainAgnostic/namespaces/pull/146
6+
status: Draft
7+
type: Informational
8+
created: 2025-06-18
9+
updated: 2025-06-18
10+
---
11+
12+
# Namespace for Sui Chains
13+
14+
Sui is a smart contract platform that uses a Move-based, object-centric data model and is optimized for parallel execution. Transactions in Sui operate on objects rather than accounts, allowing independent operations to be executed in parallel without coordination. This enables high throughput while preserving safety and determinism.
15+
16+
A Sui network is maintained by a validator committee responsible for processing transactions, reaching consensus, and producing checkpoint digests — cryptographic summaries of network state at fixed intervals. These checkpoints serve as the canonical state and ensure consistency across nodes.
17+
18+
Each network is uniquely identified by its genesis checkpoint digest — the cryptographic hash of the very first checkpoint, signed by the original validator set. This digest anchors the network’s identity in verifiable history and validator consensus.
19+
20+
## Rationale
21+
22+
Because chain identity and state in Sui revolve around checkpoints and objects rather than blocks and accounts, standard CAIP identifiers (e.g., for chains, accounts, and assets) must be adapted accordingly.
23+
24+
This namespace defines how Sui’s architecture maps to cross-chain standards to support consistent and interoperable multi-chain tooling.
25+
26+
## Governance
27+
28+
Sui protocol upgrades and standards are coordinated by the Sui Foundation in collaboration with core contributors and the broader developer community. Changes are proposed through SIPs (Sui Improvement Proposals), with open discussion and reference implementations maintained on GitHub.
29+
30+
## References
31+
32+
- [Sui Docs] — Developer documentation and concept overviews for building on Sui.
33+
- [Sui GitHub] — Official GitHub repository for the Sui smart contract platform.
34+
- [Sui SIPs] — Official GitHub repository for Sui Improvement Proposals.
35+
36+
[Sui Docs]: https://docs.sui.io/
37+
[Sui GitHub]: https://github.com/MystenLabs/sui
38+
[Sui SIPs]: https://github.com/sui-foundation/sips
39+
40+
## Copyright
41+
42+
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).

sui/caip2.md

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
---
2+
namespace-identifier: sui-caip2
3+
title: Sui Namespace - Chains
4+
author: William Robertson (@williamrobertson13)
5+
discussions-to: https://github.com/ChainAgnostic/namespaces/pull/146
6+
status: Draft
7+
type: Informational
8+
created: 2025-06-18
9+
updated: 2025-06-18
10+
---
11+
12+
# CAIP-2
13+
14+
_For context, see the [CAIP-2][] specification._
15+
16+
## Introduction
17+
18+
The Sui namespace in CAIP-2 uses human-readable chain identifiers — such as `mainnet`, `testnet`, and `devnet` — to identify specific Sui networks. These identifiers are **stable**, **concise**, and **easy to communicate**, and can be resolved to a unique genesis checkpoint digest through a supported Sui RPC interface.
19+
20+
This design provides both developer ergonomics and cryptographic assurance, allowing developers to work with simple names while still supporting verifiable chain identification.
21+
22+
## Specification
23+
24+
### Semantics
25+
26+
A valid CAIP-2 identifier in the Sui namespace takes the form:
27+
28+
`sui:<network>`
29+
30+
Where `<network>` is one of the following reserved, stable identifiers:
31+
32+
- `mainnet`
33+
- `testnet`
34+
- `devnet`
35+
36+
### Syntax
37+
38+
#### Regular Expression
39+
40+
`^sui:(mainnet|testnet|devnet)$`
41+
42+
Only these exact network identifiers are currently supported.
43+
44+
#### Example
45+
46+
`sui:mainnet`
47+
48+
### Resolution Mechanics
49+
50+
To resolve a CAIP-2 `sui:<network>` identifier into a unique chain identitier, clients typically query a trusted full node associated with the specified network. While the `suix_getChainIdentifier` JSON-RPC method is commonly used for this purpose, resolution is not limited to JSON-RPC. Other node interfaces, such as GraphQL, may also support retrieving identifiers pertinent to locating records, such as a genesis checkpoint digest unique to each chain.
51+
52+
**Sample request**
53+
54+
```json
55+
{
56+
"jsonrpc": "2.0",
57+
"id": 1,
58+
"method": "suix_getChainIdentifier",
59+
"params": []
60+
}
61+
```
62+
63+
**Sample response (for mainnet):**
64+
65+
```json
66+
{
67+
"jsonrpc": "2.0",
68+
"id": 1,
69+
"result": "35834a8a"
70+
}
71+
```
72+
73+
The response returns the first four bytes of the genesis checkpoint digest for the network.
74+
75+
## Rationale
76+
77+
This approach allows developers to use intuitive, readable CAIP-2 identifiers (e.g., `sui:mainnet`) while still achieving unambiguous and verifiable identification of the underlying chain through the genesis checkpoint digest.
78+
79+
The separation of **stable identifiers** (e.g., `sui:testnet`) from the **unambiguous chain identifier** (e.g., the identifier returned by `suix_getChainIdentifier`) is particularly important because:
80+
81+
- **`testnet` and `devnet` may be reset** by Sui maintainers, resulting in a new genesis state.
82+
- When this happens, the **genesis checkpoint digest changes**, meaning the underlying chain identifier is no longer the same.
83+
- If clients depended directly on the digest as the CAIP-2 identifier, each reset would break compatibility or require external coordination.
84+
- By resolving the digest dynamically via RPC, clients can ensure they’re talking to the correct chain, without needing to change the CAIP-2 identifier they rely on.
85+
86+
This pattern balances human readability, forward compatibility, and security.
87+
88+
### Backwards Compatibility
89+
90+
There are no legacy identifiers or alternate forms for Sui chains.
91+
92+
## Test Cases
93+
94+
Below are manually composed examples:
95+
96+
#### Sui Mainnet
97+
98+
- **CAIP-2 Chain ID:** `sui:mainnet`
99+
- **Resolved Chain Identifier:** `35834a8a`
100+
101+
#### Sui Testnet
102+
103+
- **CAIP-2 Chain ID:** `sui:testnet`
104+
- **Resolved Chain Identifier:** `4c78adac` _(value depends on the current testnet)_
105+
106+
#### Sui Devnet
107+
108+
- **CAIP-2 Chain ID:** `sui:devnet`
109+
- **Resolved Chain Identifier:** `aba3e445` _(value depends on the current devnet)_
110+
111+
## References
112+
113+
- [Sui Docs] - Developer documentation and concept overviews for building on Sui.
114+
- [Sui RPC] - Reference documentation for interacting with Sui networks via RPC.
115+
- [Sui GitHub] - Official GitHub repository for the Sui smart contract platform.
116+
- [Sui Network Info] - Information regarding Sui networks and their release schedules.
117+
- [CAIP-2] - Chain ID Specification.
118+
119+
[Sui Docs]: https://docs.sui.io/
120+
[Sui RPC]: https://docs.sui.io/references/sui-api
121+
[Sui GitHub]: https://github.com/MystenLabs/sui
122+
[Sui Network Info]: https://sui.io/networkinfo
123+
[CAIP-2]: https://chainagnostic.org/CAIPs/caip-2
124+
125+
## Copyright
126+
127+
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).

0 commit comments

Comments
 (0)