Skip to content

WCI-494: [sdk-coin-sol] MPCv2 recoverCloseATA and signAndGenerateBroadcastableTransaction#9060

Open
vibhavgo wants to merge 1 commit into
WCI-398/sdk-coin-solfrom
WCI-494/sdk-coin-sol
Open

WCI-494: [sdk-coin-sol] MPCv2 recoverCloseATA and signAndGenerateBroadcastableTransaction#9060
vibhavgo wants to merge 1 commit into
WCI-398/sdk-coin-solfrom
WCI-494/sdk-coin-sol

Conversation

@vibhavgo

Copy link
Copy Markdown
Contributor

Summary

Adds MPCv2 support to recoverCloseATA and signAndGenerateBroadcastableTransaction in sol.ts. Previously these methods were MPCv1-only — MPCv2 wallets used the wrong address derivation (MPC.deriveUnhardened vs deriveUnhardenedMps) and wrong signing material format (JSON vs CBOR reduced key shares).

Ticket: WCI-494

⚠️ Stacked PR — base branch is WCI-398/sdk-coin-sol (not master). Merge WCI-398 first.

Changes

  • Extract isMpcv2SigningMaterial() helper in sol.ts to detect MPCv2 keycards without ESM-incompatible stubs
  • Update recoverCloseATA to derive the authority address using deriveUnhardenedMps when keycard is MPCv2
  • Update signAndGenerateBroadcastableTransaction to accept isMpcV2 flag and branch between MPS DSG (MPCv2) and TSS (MPCv1) signing paths
  • Add MPCv2 unit tests for recoverCloseATA (no token balance, token balance present, bitgoKey mismatch) and signAndGenerateBroadcastableTransaction using real DKG key shares generated in a before() hook
  • Remove unused EDDSAUtils import (was only needed for the now-replaced stub-based detection)

Test Plan

  • All 602 existing unit tests pass
  • New MPCv2 tests use MPSUtil.generateEdDsaDKGKeyShares() for real key material — no stubs on ESM-incompatible modules
  • MPCv1 regression validated via getTSSSignature spy on existing recoverCloseATA and signAndGenerateBroadcastableTransaction tests

CLOSES TICKET: WCI-494

recoverCloseATA and signAndGenerateBroadcastableTransaction were
MPCv1-only. MPCv2 wallets used the wrong derivation path (MPC.deriveUnhardened
vs deriveUnhardenedMps) and wrong signing material format (JSON vs CBOR).

Route signing through MPS DSG protocol when keycard contains MPCv2 reduced
key shares, preserving the MPCv1 path unchanged.

Ticket: WCI-494
@linear-code

linear-code Bot commented Jun 18, 2026

Copy link
Copy Markdown

WCI-494

@vibhavgo vibhavgo marked this pull request as ready for review June 18, 2026 11:17
@vibhavgo vibhavgo requested a review from a team as a code owner June 18, 2026 11:17
@vibhavgo vibhavgo requested a review from Marzooqa June 18, 2026 11:20
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.

1 participant