feat: refactor MPC/TSS wallet gen to use SDK callback#260
Conversation
|
@claude review |
|
Claude finished @danielpeng1's task —— View job Code Review for MPC/TSS Wallet Generation RefactoringReview Checklist:
Overall Assessment: STRONG APPROVE ✅This is an excellent refactoring that significantly improves the codebase architecture by consolidating wallet generation logic and leveraging the SDK's standardized callback pattern. The implementation is well-structured, thoroughly tested, and follows best practices. 🏆 StrengthsArchitecture Improvements
Code Quality
🧪 Test Coverage ExcellenceThe test suite is comprehensive and well-structured:
📋 Detailed Technical ReviewECDSA MPCv2 Implementation (
|
Replaces hand-rolled ECDSA MPCv2 and EdDSA MPCv1 DKG orchestrators with the SDK's
generateWalletWithExternalSignercallback pattern, consolidating onchain and TSS wallet generation into a singlehandleGenerateWallethandler.createEcdsaMPCv2KeyGenCallbacksandcreateEddsaKeyGenCallbacksfactories inwalletGenerationCallbacks.ts; each drives both the user and backup AWM. User↔backup messages are carried in the factory closure (which is the same pattern as signing). ECDSA AWM rounds 2+3 are folded intoround2Callbackbecause both their inputs arrive with BitGo's round 1 response.handleGenerateMpcWallet+orchestrateEcdsaKeyGen+orchestrateEddsaKeyGenwith a singlekeyGenCallbacks()dispatch keyed onbaseCoin.getMPCAlgorithm().walletCreationUtils.ts(unused now but we can always get it back if needed).@bitgo-beta/sdk-coreto8.2.1-beta.1928and@bitgo-beta/sdk-apito1.10.1-beta.1923, to useEcdsaMPCv2KeyGenCallbacks,EddsaKeyGenCallbacks, andgenerateWalletWithExternalSigner.Ticket: WCN-683