Skip to content

Change chain IDs to 256-bit numbers - #353

Merged
ltitanb merged 2 commits into
augment-sign-requestsfrom
chain-id-to-u256
Aug 12, 2025
Merged

Change chain IDs to 256-bit numbers#353
ltitanb merged 2 commits into
augment-sign-requestsfrom
chain-id-to-u256

Conversation

@jclapis

Copy link
Copy Markdown
Contributor

Currently a size limit on chain IDs isn't well-defined (see https://ethereum-magicians.org/t/eip-2294-explicit-bound-to-chain-id). Some tools use an unsigned 64-bit integer (including alloy which is one of our dependencies), some use an unsigned 52-bit integer (since that's the highest value that fits without error into floats, which JS uses), but the largest value canonically is an unsigned 256-bit integer, used by Geth and friends in the EVM implementation itself.

One of the reasons the 256-bit version is popular is because it lets people use keccak256("some_relevant_string") as their Chain ID to avoid collisions. Until there's an official spec designation for a size limit, we should stick to 256-bit ones internally to support use-cases like that.

Alternatively, we should make it explicit in the documentation that Commit-Boost doesn't support chain IDs larger than the u64 limit; people will not be able to use e.g. the Signer service for custom chains that go out of those bounds.

@jclapisjclapis self-assigned this Aug 6, 2025
@jclapisjclapis added the core Core part of the repo (signer, modules interface) label Aug 6, 2025
Comment threadcrates/common/src/utils.rs Outdated
@jclapis
jclapis changed the base branch from signer-json-api to augment-sign-requestsAugust 7, 2025 07:21
@ltitanb
ltitanb merged commit 7293e5c into augment-sign-requestsAug 12, 2025
1 check passed
@ltitanb
ltitanb deleted the chain-id-to-u256 branch August 12, 2025 16:51
@jclapisjclapis mentioned this pull request Aug 13, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

coreCore part of the repo (signer, modules interface)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@jclapis@ManuelBilbao@ltitanb