Skip to content

fix(abstract-eth,sdk-core): use coin chain ID when deriving signableHex (WCI-1398) - #9602

Merged
Marzooqa merged 1 commit into
masterfrom
fix-wci-1398-chain-id-in-assert
Aug 31, 2026
Merged

fix(abstract-eth,sdk-core): use coin chain ID when deriving signableHex (WCI-1398)#9602
Marzooqa merged 1 commit into
masterfrom
fix-wci-1398-chain-id-in-assert

Conversation

@Marzooqa

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #9600. Re-enables the assertSignableConsistency call with the correct fix.

  • Root cause: unsigned EVM transactions have v=0 — no chain ID in the serialized bytes. TransactionFactory.fromSerializedData without an explicit Common defaults to mainnet (chain ID 1), while the server computes signableHex with the correct chain ID (e.g. 97 for BSC testnet). Derivation mismatch → false-positive tamper error.
  • Fix: pass getCustomChainCommon(this.getChainId()) when parsing serializedTxHex so the EIP-155 preimage is derived with the coin's actual chain ID
  • Re-enables the assertSignableConsistency call in ecdsaMPCv2.ts
  • Updates BSC and XDC test helpers to derive signableHex with the correct Common

Test plan

  • CI passes
  • BSC unit tests: 40 passing
  • XDC unit tests: 63 passing
  • Repro scripts (repro-tbsc.js, repro-txdc.js) produce txids against staging
  • QA automation @wp_api_tbsc and @wp_api_txdc pass

Fixes: WCI-1398

@Marzooqa
Marzooqa requested review from a team as code owners August 31, 2026 07:45
@linear-code

linear-code Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

WCI-1398

@Marzooqa
Marzooqa force-pushed the fix-wci-1398-chain-id-in-assert branch from 69837ea to fca2fe1 Compare August 31, 2026 08:02
Base automatically changed from revert-wci-1398-assert-call to master August 31, 2026 09:07
@Marzooqa
Marzooqa force-pushed the fix-wci-1398-chain-id-in-assert branch from fca2fe1 to b40a287 Compare August 31, 2026 09:12
Comment thread modules/abstract-eth/src/abstractEthLikeNewCoins.ts
@Marzooqa
Marzooqa force-pushed the fix-wci-1398-chain-id-in-assert branch from b40a287 to 6962d17 Compare August 31, 2026 14:11
…ex (WCI-1398)

Unsigned EVM transactions have v=0 — no chain ID in the serialized bytes.
TransactionFactory.fromSerializedData without an explicit Common defaults
to mainnet (chain ID 1), while the server computes signableHex with the
correct chain ID (e.g. 97 for BSC testnet), causing a false-positive
tamper error on every signing flow.

Fix: pass getCustomChainCommon(this.getChainId()) when parsing the
serialized tx so the EIP-155 preimage is derived with the correct chain
ID. For coins without CoinFeature.EIP1559 (BSC, XDC), pin the Common
hardfork to petersburg so type-2 txs cannot be decoded as EIP-1559.
Re-enable the assertSignableConsistency call in ecdsaMPCv2.

TICKET: WCI-1398
Co-authored-by: Cursor <cursoragent@cursor.com>
@Marzooqa
Marzooqa force-pushed the fix-wci-1398-chain-id-in-assert branch from 6962d17 to 3762bc6 Compare August 31, 2026 14:22
@Marzooqa
Marzooqa merged commit 20155fc into master Aug 31, 2026
26 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.

2 participants