|
| 1 | +--- |
| 2 | +caip: CAIP-363 |
| 3 | +title: Chain ID Wildcard |
| 4 | +author: Daniel Rocha (@danroc) |
| 5 | +discussions-to: https://github.com/ChainAgnostic/CAIPs/discussions/364 |
| 6 | +status: Draft |
| 7 | +type: Standard |
| 8 | +created: 2025-07-01 |
| 9 | +requires: CAIP-2, CAIP-10 |
| 10 | +--- |
| 11 | + |
| 12 | +## Simple Summary |
| 13 | + |
| 14 | +This CAIP extends CAIP-2 and CAIP-10 by reserving the `_` character as a |
| 15 | +wildcard reference for "all chain IDs" within a CAIP-2 namespace. This enables |
| 16 | +wallets and applications to represent account identity across all chains of a |
| 17 | +given namespace. |
| 18 | + |
| 19 | +This CAIP makes no assumptions about how the address is derived or whether it |
| 20 | +is valid across all chains in the namespace. The use of `_` simply denotes |
| 21 | +intent to refer to the same address across chains, without implying |
| 22 | +compatibility or derivation logic. |
| 23 | + |
| 24 | +## Abstract |
| 25 | + |
| 26 | +By reserving the `_` wildcard in CAIP-2-compliant chain ID definitions, and |
| 27 | +supporting it within CAIP-10 account identifiers, this CAIP enables an address |
| 28 | +to represent a multichain account. For example, `eip155:_:<address>` signifies |
| 29 | +the given address across all chains in the `eip155` namespace. |
| 30 | + |
| 31 | +## Motivation |
| 32 | + |
| 33 | +Wallets and identity systems increasingly need to represent multichain |
| 34 | +accounts. The lack of a standard for denoting an address across all chains in a |
| 35 | +namespace hinders interoperability. Reserving `_` as a wildcard chain ID solves |
| 36 | +this by enabling a consistent and extensible mechanism for such expressions. |
| 37 | + |
| 38 | +## Specification |
| 39 | + |
| 40 | +### CAIP-2 Extension |
| 41 | + |
| 42 | +In addition to the existing CAIP-2 specification: |
| 43 | + |
| 44 | +> A new reserved chain ID value `_` MUST be supported in all namespaces to |
| 45 | +> indicate "all chains" in that namespace. |
| 46 | +
|
| 47 | +Thus, the chain ID format becomes: |
| 48 | + |
| 49 | +```text |
| 50 | +<namespace>:<reference | _> |
| 51 | +``` |
| 52 | + |
| 53 | +Where `_` is interpreted as "all chain references within this namespace." |
| 54 | + |
| 55 | +### CAIP-10 Extension |
| 56 | + |
| 57 | +Extend the CAIP-10 account ID to support the wildcard chain reference: |
| 58 | + |
| 59 | +```text |
| 60 | +<namespace>:_:<account-address> |
| 61 | +``` |
| 62 | + |
| 63 | +For example: |
| 64 | + |
| 65 | +- `eip155:_:0x59f3...d0c3` represents the same address across all `eip155` |
| 66 | + chains. |
| 67 | + |
| 68 | +- `solana:_:DAXa...bx77` represents a Solana account across all Solana chains |
| 69 | + (e.g., Mainnet, Testnet, and Devnet). |
| 70 | + |
| 71 | +### Reserved Character |
| 72 | + |
| 73 | +A single `_` character is reserved solely for the wildcard chain reference and |
| 74 | +MUST NOT be designated as a valid reference or account identifier in any future |
| 75 | +[CAIP-2] profile. |
| 76 | + |
| 77 | +## Rationale |
| 78 | + |
| 79 | +The `_` character is not currently a valid chain ID reference in any known |
| 80 | +namespace, minimizing the risk of collision. It is also supported by the CAIP-2 |
| 81 | +grammar, ensuring that it can be parsed correctly without breaking existing |
| 82 | +implementations. |
| 83 | + |
| 84 | +## Backwards Compatibility |
| 85 | + |
| 86 | +This CAIP is backwards compatible. Existing implementations that do not support |
| 87 | +`_` will simply reject these identifiers as invalid, while updated systems can |
| 88 | +handle them appropriately. |
| 89 | + |
| 90 | +## Reference Implementation |
| 91 | + |
| 92 | +No code changes are required in CAIP-2 and CAIP-10, but supporting |
| 93 | +implementations (e.g., wallets, dapps) should treat `_` as matching any chain |
| 94 | +reference within the specified namespace. |
| 95 | + |
| 96 | +## Copyright |
| 97 | + |
| 98 | +Copyright and related rights waived via CC0. |
| 99 | + |
| 100 | +## References |
| 101 | + |
| 102 | +- [CAIP-2] |
| 103 | +- [CAIP-10] |
| 104 | + |
| 105 | +[CAIP-2]: https://chainagnostic.org/CAIPs/caip-2 |
| 106 | +[CAIP-10]: https://chainagnostic.org/CAIPs/caip-10 |
0 commit comments