WCI-494: [sdk-coin-sol] MPCv2 recoverCloseATA and signAndGenerateBroadcastableTransaction#9060
Open
vibhavgo wants to merge 1 commit into
Open
WCI-494: [sdk-coin-sol] MPCv2 recoverCloseATA and signAndGenerateBroadcastableTransaction#9060vibhavgo wants to merge 1 commit into
vibhavgo wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds MPCv2 support to
recoverCloseATAandsignAndGenerateBroadcastableTransactioninsol.ts. Previously these methods were MPCv1-only — MPCv2 wallets used the wrong address derivation (MPC.deriveUnhardenedvsderiveUnhardenedMps) and wrong signing material format (JSON vs CBOR reduced key shares).Ticket: WCI-494
Changes
isMpcv2SigningMaterial()helper insol.tsto detect MPCv2 keycards without ESM-incompatible stubsrecoverCloseATAto derive the authority address usingderiveUnhardenedMpswhen keycard is MPCv2signAndGenerateBroadcastableTransactionto acceptisMpcV2flag and branch between MPS DSG (MPCv2) and TSS (MPCv1) signing pathsrecoverCloseATA(no token balance, token balance present, bitgoKey mismatch) andsignAndGenerateBroadcastableTransactionusing real DKG key shares generated in abefore()hookEDDSAUtilsimport (was only needed for the now-replaced stub-based detection)Test Plan
MPSUtil.generateEdDsaDKGKeyShares()for real key material — no stubs on ESM-incompatible modulesgetTSSSignaturespy on existingrecoverCloseATAandsignAndGenerateBroadcastableTransactiontestsCLOSES TICKET: WCI-494