|
| 1 | +--- |
| 2 | +namespace-identifier: eip155-caip350 |
| 3 | +title: eip155 Namespace - Interoperable Address |
| 4 | +binary-key: 0000 |
| 5 | +author: Teddy (@0xteddybear), Joxes (@0xJoxess), Skeletor Spaceman (@skeletor-spaceman), Racu (@0xRacoon), TiTi (@0xtiti), Gori (@0xGorilla), Ardy (@0xArdy), Onizuka (@onizuka-wl) |
| 6 | +discussions-to: https://ethereum-magicians.org/t/erc-7930-interoperable-addresses/23365 |
| 7 | +status: Draft |
| 8 | +type: Standard |
| 9 | +created: 2025-04-23 |
| 10 | +requires: CAIP-2 |
| 11 | +--- |
| 12 | + |
| 13 | +## Namespace Reference |
| 14 | + |
| 15 | +ChainType binary key: `0x0000` |
| 16 | +[CAIP-104] namespace: `eip155` |
| 17 | + |
| 18 | +## Chain reference |
| 19 | + |
| 20 | +See [EIP-155] and [EIP-2294]. |
| 21 | + |
| 22 | +### Text representation |
| 23 | + |
| 24 | +``` |
| 25 | +eip155:<number> |
| 26 | +``` |
| 27 | +Where `<number>` is the decimal representation of the chain's `chainId`, without leading zeroes. |
| 28 | + |
| 29 | +##### Text representation -> CAIP-2 conversion |
| 30 | + |
| 31 | +In the case where the `chainId` is larger than what can be represented in 32 decimal characters, the leading 32 characters should be used. |
| 32 | + |
| 33 | +##### CAIP-2 - text representation conversion |
| 34 | + |
| 35 | +This transformation would not be fully deterministic in the case where `chainId`s larger than 10^32 are used. It is assumed wallets and other software will be able to differentiate between chains from just the leading 32 decimal characters, and use a lookup table of popular chains to complete the missing information to convert CAIP-2 identifiers to this standard. |
| 36 | + |
| 37 | +#### Binary representation |
| 38 | + |
| 39 | +The bare `chainId` encoded as a big-endian unsigned integer of the minimum necessary amount of bytes will be used [^1], and leading zeroes will be prohibited. |
| 40 | + |
| 41 | +#### Text -> binary conversion |
| 42 | + |
| 43 | +Encode the decimal integer as a big-endian unsigned integer using the minimum necessary amount of bytes. |
| 44 | + |
| 45 | +#### Binary -> text conversion |
| 46 | + |
| 47 | +Compute the decimal representation of the stored big-endian unsigned integer. |
| 48 | + |
| 49 | +#### Examples |
| 50 | + |
| 51 | +Ethereum Mainnet: `0x01` (integer `1`, encoded as uint8) |
| 52 | + |
| 53 | +Optimism Mainnet: `0x0A` (integer `10`, encoded as uint8) |
| 54 | + |
| 55 | +Ethereum Sepolia: `0xaa36a7` (integer `11155111`, encoded as uint24) |
| 56 | + |
| 57 | +## Addresses |
| 58 | + |
| 59 | +Bytes of EVM addresses are trivially stored as the payload. |
| 60 | +It's worth noting that addresses are currently 20 bytes, but that might change in the future, most likely to 32 bytes [^2] |
| 61 | + |
| 62 | +### Text representation |
| 63 | + |
| 64 | +For text representation, the 20 bytes of EVM addresses should be hexadecimal-encoded according to [EIP-55]. |
| 65 | +This standard deliberately does not define the text representation of EVM addresses if they are extended in the future, since it's not possible to know which human-readable representation will be more familiar to users in such hypothetical scenario. |
| 66 | +This profile should be amended in the future to reflect it in such a case. |
| 67 | + |
| 68 | +##### Text representation -> customary text address formats conversion |
| 69 | + |
| 70 | +See [EIP-55]. |
| 71 | + |
| 72 | +##### Customary text addresses -> text representation conversion |
| 73 | + |
| 74 | +See [EIP-55]. |
| 75 | + |
| 76 | +#### Binary representation |
| 77 | + |
| 78 | +Bytes of EVM addresses are trivially stored as the payload. |
| 79 | +It's worth noting that addresses are currently 20 bytes, but that might change in the future, most likely to 32 bytes [^2]. |
| 80 | + |
| 81 | +#### Text -> binary conversion |
| 82 | + |
| 83 | +Specified in [EIP-55]. |
| 84 | + |
| 85 | +#### Binary -> text conversion |
| 86 | + |
| 87 | +Specified in [EIP-55]. |
| 88 | + |
| 89 | +#### Examples |
| 90 | + |
| 91 | +See [EIP-55]. |
| 92 | + |
| 93 | +### Extra considerations |
| 94 | + |
| 95 | +Wallets and other software are expected to be able to fetch the extra information needed to convert from [CAIP-2] to this standard. |
| 96 | + |
| 97 | +## References |
| 98 | + |
| 99 | +[^1]: This makes it possible to represent some chains using the full word as their chainid, which CAIP-2 does not support since the set of values representable with 32 `a-zA-Z0-9` characters has less than `type(uint256).max` elements. This is done in an effort to support chains whose ID is the output of `keccak256`, as proposed in [ERC-7785]. |
| 100 | +[^2]: With EVM Object Format as a prerequisite, Address Space Expansion could be implemented. If that happens, expanded addresses may be represented in 32 bytes, but pre-expansion addresses must remain 20 bytes in order to preserve a consistent address. |
| 101 | + |
| 102 | +[CAIP-2]: https://chainagnostic.org/CAIPs/caip-2 |
| 103 | +[CAIP-104]: https://chainagnostic.org/CAIPs/caip-104 |
| 104 | +[EIP-55]: https://eips.ethereum.org/EIPS/eip-55 |
| 105 | +[EIP-155]: https://eips.ethereum.org/EIPS/eip-155 |
| 106 | +[EIP-2294]: https://eips.ethereum.org/EIPS/eip-2294 |
0 commit comments