feat(sdk-core): extract isMpcV2Keycard and signEddsaMpcV2RecoveryTx into shared utils - #9449
Draft
vibhavgo wants to merge 3 commits into
Draft
Conversation
…nto shared utils Ticket: WCI-1276 Add EddsaSigningMaterial discriminated union, isMpcV2Keycard (detects v1 vs v2 keycard format), and signEddsaMpcV2RecoveryTx (full MPCv2 recovery signing) to eddsaMPCv2.ts. These functions were duplicated inline across TON and Substrate coin recovery implementations. - Remove sjcl.decrypt fallback: all decryption routes through bitgo.decrypt, which handles both v1 (SJCL) and v2 (Argon2id) envelopes. - Export all new symbols from sdk-core package root. - 17 tests covering both functions including end-to-end signature verification. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nd getEddsaMpcV2RecoveryKeySharesFromReducedKey Ticket: WCI-1276 Reverts the bitgo-required change: both functions keep bitgo? optional with sjcl.decrypt fallback for v1-only callers. isMpcV2Keycard and signEddsaMpcV2RecoveryTx also remain with optional bitgo. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
vibhavgo
marked this pull request as draft
August 7, 2026 10:18
Ticket: WCI-1276 Replace inline MPCv2 keycard detection and signing in abstract-substrate and sdk-coin-sol with shared helpers isMpcV2Keycard and signEddsaMpcV2RecoveryTx from sdk-core. Drop-in replacement — no behaviour change, no test modifications required. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
EddsaSigningMaterialdiscriminated union (v1 | v2) toeddsaMPCv2.tsisMpcV2Keycard(userKey, walletPassphrase, bitgo?)— detects v1 (JSON/SJCL) vs v2 (CBOR) keycard, returns typed signing material; sjcl fallback retained for optionalbitgosignEddsaMpcV2RecoveryTx(params)— full MPCv2 recovery signing: decrypt key shares → validatecommonKeyChain→ MPS DSGsdk-corepackage rootabstract-substrateandsdk-coin-solwith the shared helpers — drop-in, no behaviour change, no test modificationsContext
WCI-1276 —
isMpcV2KeycardandsignEddsaMpcV2RecoveryTxwere duplicated inline across coin modules (Substrate/DOT/POLYX, SOL). This PR extracts them intosdk-coreand replaces all call sites.This branch is based on
feat/abstract-substrate/WCI-1239and should be merged after that branch lands.Modules changed
@bitgo/sdk-core@bitgo/abstract-substrateisMpcV2Keycardto shared helper; removes localSubstrateSigningMaterialtype@bitgo/sdk-coin-solisMpcv2SigningMaterialand MPCv2 signing block to shared helpersTest plan
yarn testinmodules/sdk-core— 18 passingyarn buildinmodules/abstract-substrate— cleanyarn testinmodules/sdk-coin-sol— 482 passing (3 pre-existing env-var failures unrelated to this PR)🤖 Generated with Claude Code