feat(sdk-coin-sui): add MPCv2 signed hot recovery support - #9495
Closed
ralph-bitgo[bot] wants to merge 1 commit into
Closed
feat(sdk-coin-sui): add MPCv2 signed hot recovery support#9495ralph-bitgo[bot] wants to merge 1 commit into
ralph-bitgo[bot] wants to merge 1 commit into
Conversation
Detect keycard format (MPCv1 JSON vs MPCv2 CBOR) in Sui.recover() and its private helpers (recoverSuiToken, signRecoveryTransaction) via the shared getEddsaSigningMaterial helper, and dispatch MPCv2 keycards to signEddsaMpcV2RecoveryTx instead of the MPCv1-only EDDSAMethods.getTSSSignature path. The raw 64-byte signature is wrapped in SUI's existing 0x00-flag + signature + pubkey envelope before being attached to the transaction builder, so both native transfer and token recovery route through the same dispatch. MPCv2 hot wallets could not recover funds via WRW: recover() only understood the MPCv1 JSON keycard format and threw when handed an MPCv2 CBOR keycard. This mirrors the pattern already landed for DOT (WCI-1227) and unblocks WCI-1234 (recoverConsolidations MPCv2 support), which depends on this dispatch existing in recover(). Ticket: WCI-1224 Session-Id: bf130f11-6bd0-4a91-88c6-a9138ecc96ab Task-Id: 179247fb-4ff6-49f3-9849-df120620c98b
Contributor
bitgo-ai-agent-dev
Bot
force-pushed
the
WCI-1234-sui-mpcv2-recover-consolidations-pt1
branch
from
August 13, 2026 12:19
e321956 to
0d0eb03
Compare
ralph-bitgo
Bot
force-pushed
the
WCI-1234-sui-mpcv2-recover-consolidations-pt1
branch
from
August 13, 2026 12:19
0d0eb03 to
fecc42c
Compare
5 tasks
Author
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.
Stack
This PR is part 1 of 2 in a stack. Review and merge in order:
recover()(base:master) ← you are hererecoverConsolidations()(base: this branch)What
getEddsaSigningMaterial/signSuiMpcV2Recoveryprotected helpers onSuithat detect keycard format (MPCv1 JSON vs MPCv2 CBOR) and dispatch signing accordingly.signRecoveryTransaction()(used by both native SUI transfer and token recovery) now branches onsigningMaterial.version: MPCv2 keycards route throughsignEddsaMpcV2RecoveryTx, with the raw 64-byte signature wrapped in SUI's existing0x00-flag + signature + pubkey envelope before being attached to the transaction builder; MPCv1 keycards keep the existingEDDSAMethods.getTSSSignatureflow.if (!x) throwguards withassert()per code-quality guidance in the ticket.Why
MPCv2 hot wallets could not recover funds via WRW:
Sui.recover()only understood the MPCv1 JSON keycard format and had no path for MPCv2 CBOR keycards. This mirrors the pattern already landed for DOT (WCI-1227) and unblocks WCI-1234 (recoverConsolidations()MPCv2 support), which depends on this dispatch existing inrecover().Test plan
nacl.sign.detached.verify)getTSSSignaturebitgoKeyvs. keycardcommonKeyChainthrowsyarn unit-testpasses (206/206) andyarn lintis cleanTicket: WCI-1224