Skip to content

Replace chain_id with chain_hash_fragment in TxDetails, to aid in deterministic signature checking#3035

Merged
theodorebugnet merged 6 commits into
theodore/multisig-upgradefrom
theodore/replace-chainid-with-chainhash
Jul 20, 2026
Merged

Replace chain_id with chain_hash_fragment in TxDetails, to aid in deterministic signature checking#3035
theodorebugnet merged 6 commits into
theodore/multisig-upgradefrom
theodore/replace-chainid-with-chainhash

Conversation

@theodorebugnet

@theodorebugnet theodorebugnet commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Description

Request from Bullet. chain_id is not needed for security - it's already hashed as part of the chain hash - and seems to be rarely, if ever, checked by users. So remove it in favor of adding a chain hash fragment which allows eliminating the trial-and-error loop in verifying transactions when multiple chain hash overrides are active.

Also adds consistency verification to V1 signing flows to assert that all signatures are done over the same chain has, helping avoid footguns if users sign a multisig around the exact time a rollup upgrades its chain hash.

  • I have updated CHANGELOG.md with a new entry if my PR makes any breaking changes or fixes a bug. If my PR removes a feature or changes its behavior, I provide help for users on how to migrate to the new behavior.
  • I have carefully reviewed all my Cargo.toml changes before opening the PRs. (Are all new dependencies necessary? Is any module dependency leaked into the full-node (hint: it shouldn't)?)

Linked Issues

  • Fixes # (issue, if applicable)
  • Related to # (issue)

Testing

Describe how these changes were tested. If you've added new features, have you added unit tests?

Docs

Describe where this code is documented. If it changes a documented interface, have the docs been updated?

Rendered docs are available at https://sovlabs-ci-rustdoc-artifacts.us-east-1.amazonaws.com/<BRANCH_NAME>/index.html

@theodorebugnet
theodorebugnet force-pushed the theodore/replace-chainid-with-chainhash branch from e8975fd to 21d9f40 Compare July 10, 2026 13:02
@theodorebugnet
theodorebugnet force-pushed the theodore/replace-chainid-with-chainhash branch from 21d9f40 to 5884624 Compare July 10, 2026 13:15
…against chain hash prefix collision at build time
  - make TS clients refresh, rebuild, and validate fragments consistently
  - centralize fragment derivation and remove obsolete chain-ID plumbing
  - fix some additional examples, tests, and documentation that had been overlooked
@theodorebugnet
theodorebugnet force-pushed the theodore/replace-chainid-with-chainhash branch 3 times, most recently from 984dc7b to 8ae9926 Compare July 14, 2026 13:05
@theodorebugnet
theodorebugnet force-pushed the theodore/replace-chainid-with-chainhash branch from 8ae9926 to 2452eb8 Compare July 14, 2026 13:08
items:
type: integer
format: uint64
PartialTransaction:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were unused anywhere in the spec and stale

/// The fragment is the first eight bytes of the chain hash. Interpreting it as
/// little-endian means Borsh serializes the `u64` back to those same eight bytes.
#[must_use]
pub const fn chain_hash_fragment(chain_hash: &[u8; 32]) -> u64 {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason it's in the universal-wallet crate is that it's a dependency of the web3 crate, and generally going to be needed by all clients (at least all rust clients), so it's added as a helper here to avoid requiring duplication of the logic.

@theodorebugnet
theodorebugnet merged commit c0f05eb into theodore/multisig-upgrade Jul 20, 2026
25 of 28 checks passed
@theodorebugnet
theodorebugnet deleted the theodore/replace-chainid-with-chainhash branch July 20, 2026 00:40
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants