Skip to content

fix(abstract-eth,sdk-core): enforce signableHex/serializedTxHex consistency for BSC and XDC (WCI-1398) - #9526

Merged
davidkaplanbitgo merged 3 commits into
masterfrom
WCI-1398-bsc-xdc-signable-consistency-check
Aug 26, 2026
Merged

fix(abstract-eth,sdk-core): enforce signableHex/serializedTxHex consistency for BSC and XDC (WCI-1398)#9526
davidkaplanbitgo merged 3 commits into
masterfrom
WCI-1398-bsc-xdc-signable-consistency-check

Conversation

@Marzooqa

@Marzooqa Marzooqa commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

For BSC and XDC, the ECDSA MPCv2 signing flow verifies serializedTxHex but signs signableHex — both are independent server-supplied fields. This PR adds a consistency check that locally derives the expected signableHex from serializedTxHex and throws before signing if they diverge.

Changes

  • Adds CoinWithSignableConsistency interface and type guard to sdk-core
  • AbstractEthLikeNewCoins implements assertSignableConsistency using TransactionFactory.fromSerializedData, handling both EIP-1559 and legacy EIP-155 transactions
  • ecdsaMPCv2.ts calls the check after verifyTransaction succeeds in the TSS_VERIFY_USE_SERIALIZED_TX_HEX branch

Test plan

  • Unit tests: consistent pair passes, tampered signableHex throws — BSC + XDC
  • Full unit test suites passing (BSC, XDC, abstract-eth)
  • End-to-end: native sends on staging for BSC and XDC
  • QA automation playwright tests @wp_api_tbsc and @wp_api_txdc passed

@linear-code

linear-code Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

WCI-1398

@Marzooqa
Marzooqa force-pushed the WCI-1398-bsc-xdc-signable-consistency-check branch from 85b5d8b to 0e6fa9b Compare August 25, 2026 14:20
…stency for BSC and XDC

For TSS_VERIFY_USE_SERIALIZED_TX_HEX coins (BSC, XDC), the ECDSA MPCv2
signing flow calls verifyTransaction with serializedTxHex but then signs
signableHex. Both values are server-supplied independently, allowing a
malicious server to pair a benign serializedTxHex (shown to verify) with
a tampered signableHex (what actually gets signed).

Adds a CoinWithSignableConsistency interface to sdk-core, implemented by
AbstractEthLikeNewCoins. After verifyTransaction succeeds, ecdsaMPCv2
calls assertSignableConsistency to derive the expected signableHex from
serializedTxHex and throw InvalidTransactionError if they diverge.

WCI-1398

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

TICKET: WCI-1398
…tion; add XDC test

- Replace try/catch EIP-1559/legacy detection with TransactionFactory.fromSerializedData
- Add assertSignableConsistency test coverage for sdk-coin-xdc (Gap 2 / WCI-1398)

TICKET: WCI-1398
…mjs packages

Add @ethereumjs/rlp, @ethereumjs/tx, and ethereumjs-util as devDependencies
to satisfy CI dependency checks for the assertSignableConsistency tests.

TICKET: WCI-1398
@Marzooqa
Marzooqa force-pushed the WCI-1398-bsc-xdc-signable-consistency-check branch from 0e6fa9b to b29025d Compare August 26, 2026 10:23
@Marzooqa
Marzooqa marked this pull request as ready for review August 26, 2026 12:25
@Marzooqa
Marzooqa requested review from a team as code owners August 26, 2026 12:25
@davidkaplanbitgo
davidkaplanbitgo merged commit 220142c into master Aug 26, 2026
38 of 40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants