feat(sdk-core): wire eddsaMPCv2Callbacks into generateWalletWithExternalSigner#9200
Conversation
7997d9a to
5a10bf9
Compare
5a10bf9 to
8cd823e
Compare
|
Claude finished @Marzooqa's task —— View job Code Review for EdDSA MPCv2 Callbacks IntegrationTodo List:
Review SummaryThis PR successfully implements EdDSA MPCv2 callback support in the external signer flow. The implementation is well-structured, includes comprehensive test coverage, and maintains backward compatibility while adding the new MPCv2 functionality. ✅ Strengths
|
Add createKeychainsWithExternalSigner to EddsaMPCv2Utils to orchestrate EdDSA MPCv2 DKG via callbacks and WP round-trips, following the same external-signer pattern as EcdsaMPCv2Utils (ecdsaMPCv2.ts:655-735). The method: 1. Resolves the BitGo EdDSA MPCv2 GPG key (eddsaMpcv2PublicKey, not the ECDSA mpcv2PublicKey) and guards against a missing key. 2. Calls initializeCallback to let the external signer generate GPG keys. 3. Calls round1Callback for both parties' DKG round-1 messages. 4. Sends round-1 messages to WP via sendKeyGenerationRound1. 5. Calls round2Callback with BitGo's round-1 reply. 6. Sends round-2 messages to WP via sendKeyGenerationRound2, which returns commonPublicKeychain. 7. Calls finalizeCallback with BitGo's round-2 reply and asserts that the keychain returned by the callback matches commonPublicKeychain. 8. Registers user, backup, and BitGo keychains with isMPCv2: true. Messages are MPSTypes.MPSSignedMessage passed directly — no formatBitgoBroadcastMessage / formatP2PMessage wrapping needed (EdDSA MPS uses GPG detached signatures instead of DKLs auth-enc). Tests cover: callback invocation order, argument threading between rounds, isMPCv2 keychain registration, mismatched commonKeychain rejection, session-ID mismatch rejection, and missing BitGo GPG key rejection. Ticket: WCI-916 Session-Id: 52cc0308-5664-4de7-adc0-e1ddeebb9011 Task-Id: 489a58ea-0bff-4b3a-bd2e-8d32cda52a7b
…nalSigner Add eddsaMPCv2Callbacks field to GenerateWalletWithExternalSignerOptions and add routing in generateMpcWalletWithExternalSigner to dispatch to EddsaMPCv2Utils.createKeychainsWithExternalSigner when the field is set. Changes: - iWallets.ts: add eddsaMPCv2Callbacks?: EddsaMPCv2KeyGenCallbacks to GenerateWalletWithExternalSignerOptions - wallets.ts: update hasMpcCallbacks to include eddsaMPCv2Callbacks; add an EdDSA MPCv2 branch that calls EddsaMPCv2Utils; guard against passing both eddsaMPCv2Callbacks and eddsaCallbacks simultaneously - walletsExternalSigner.ts: new test block covering routing to EddsaMPCv2Utils, mutual-exclusion rejection, no-callbacks rejection, and MPCv1 path unchanged verification Ticket: WCI-917 Session-Id: 23a5c77a-c909-407f-bf3e-a820c9e88aea Task-Id: 38b68db1-6599-4911-9635-d408663b0d82
8cd823e to
417f154
Compare
a6d8642 to
78ad370
Compare
What
eddsaMPCv2Callbacks?: EddsaMPCv2KeyGenCallbackstoGenerateWalletWithExternalSignerOptionsiniWallets.tshasMpcCallbacksinwallets.tsto includeeddsaMPCv2CallbackssocreateKeychainCallback+ MPCv2 callbacks is rejectedgenerateMpcWalletWithExternalSigner: dispatches toEddsaMPCv2Utils.createKeychainsWithExternalSignerwheneddsaMPCv2Callbacksis set; rejects if botheddsaMPCv2CallbacksandeddsaCallbacksare provided; falls through to the existing MPCv1 path otherwiseEddsaMPCv2Utils, mutual-exclusion rejection, no-callbacks rejection, MPCv1 path unchangedWhy
EddsaMPCv2KeyGenCallbackstype (WCI-894) into the external signer flow so consumers can opt into MPCv2 by passingeddsaMPCv2CallbacksDependencies
wci-894-define-eddsa-mpcv2-keygen-callback-typescontains theEddsaMPCv2KeyGenCallbackstype definitions (WCI-894)EddsaMPCv2Utils.createKeychainsWithExternalSigneris added by WCI-916; the implementation uses anas anycast until that lands and the type annotation will resolve when these branches are merged togetherTest plan
walletsExternalSigner.tspassgenerateWalletWithExternalSigner - EdDSA MPCv2 TSSdescribe block (7 tests) all passeddsaMPCv2Callbacksroutes toEddsaMPCv2Utils.createKeychainsWithExternalSignerwith correct paramseddsaMPCv2Callbacks+eddsaCallbackstogether is rejectededdsaCallbacksstill routes to the MPCv1EddsaUtilspath (not MPCv2)createKeychainCallback+eddsaMPCv2Callbackstogether is rejectedTicket: WCI-917