Skip to content

Commit

Permalink
Eip155 caip10/typo in regex (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
bumblefudge authored Sep 12, 2024
2 parents d77e12d + f58b044 commit 056e0e3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
6 changes: 3 additions & 3 deletions eip155/caip10.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ The `chain_id` string will be ammended as follows:

```
chain_id: namespace + ":" + network_id + ":" + reference
network_id: [0-9]{1,19}
namespace: [-a-z0-9]{3,8}
reference: 0x[a-fA-F0-9]{1,32}
network_id: [0-9]{1,64}
reference: 0x[a-fA-F0-9]{40}
```

### Backwards Compatibility
Expand Down Expand Up @@ -91,7 +91,7 @@ As the Ethereum namespace evolved, user-agents that connect to dapps through an
- [ERC-20][]: Basic [aka Fungible] Token Standard
- [ERC-721][]: Non-Fungible Token Standard

[Chainid.network]: https://github.com/ethereum-lists/chains
[ethereum-lists/chains]: https://github.com/ethereum-lists/chains
[CAIP-2]: https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-2.md
[CAIP-10]: https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-10.md
[CAIP-19]: https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-19.md
Expand Down
19 changes: 6 additions & 13 deletions eip155/caip2.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,17 @@ replaces: CAIP-3

## Rationale

The chain ID defined in EIP155 is the most widely used chain identifier in the
Ethereum ecosystem known to the authors. It optimizes for uniqueness and its
usage for replay protection has helped it achieve wide adoption. Unique network
IDs can be self-registered in the [ethereum-lists/chains][] registry.
The chain ID defined in EIP155 is the most widely used chain identifier in the Ethereum ecosystem known to the authors. It optimizes for uniqueness and its usage for replay protection has helped it achieve wide adoption.
Unique network IDs can be self-registered in the [ethereum-lists/chains][] registry.

## Syntax

For reference, The format of reference currently specified in EIP155 is an
unsigned integer in decimal representation. Due to length restrictions of the
reference field (32 characters), the largest supported `CHAIN_ID` at time of
writing is `99999999999999999999999999999999`.

For reference, The format of reference currently specified in EIP155 is an unsigned integer of type UINT256, which is 64 characters long in hexadecimal notation.
That said, the longest `chainId` registered in the registry is 15 characters long, and compatibility with major wallets and common tooling in the Ethereum ecosystem is endangered when `chainId`s exceed 55 bits, so implementers are encouraged to observe the much shorter profile defined in [EIP-2294](https://ethereum-magicians.org/t/eip-2294-explicit-bound-to-chain-id/11090/14) in contexts where longer chainIds need to be supported.

### Resolution Method

To resolve a blockchain reference for the EIP155 namespace, make a JSON-RPC
request to a blockchain node with method `eth_chainId`, for example:
To resolve a blockchain reference for the EIP155 namespace, make a JSON-RPC request to a blockchain node with method `eth_chainId`, for example:

```
// Request
Expand All @@ -52,8 +46,7 @@ request to a blockchain node with method `eth_chainId`, for example:
}
```

The response will return a base-16-encoded integer that should be converted to
base 10 to format an EIP155-compatible blockchain reference.
The response will return a base-16-encoded integer that should be converted to base 10 to format an EIP155-compatible blockchain reference.

## Test Cases

Expand Down

0 comments on commit 056e0e3

Please sign in to comment.