feat(sdk-coin-sol): MPCv2 recoverNestedAta#9114
Conversation
b5427ad to
3637d31
Compare
|
Claude finished @vibhavgo's task —— View job Code Review: MPCv2 recoverNestedAta Implementation ✅Todo List:
Code Review SummaryThis PR successfully adds MPCv2 support to the ✅ Implementation Changes (sol.ts:1674-1711)Strengths:
Security Considerations:
✅ Test Coverage (sol.ts test file)Comprehensive Test Suite:
Test Quality:
📋 Minor Observations
🔧 Alignment with RequirementsThe implementation fully addresses the stated objectives:
📊 Code Quality Assessment
Recommendation: APPROVE ✅This is a well-implemented feature that correctly adds MPCv2 support to The changes are minimal, focused, and low-risk while solving the critical issue where MPCv2 wallets would fail due to incorrect signer address derivation. |
Update recoverNestedAta to detect MPCv2 keycards via isEddsaMpcV1SigningMaterial and derive the wallet root address using deriveUnhardenedMps instead of MPC.deriveUnhardened. Pass the isMpcV2 flag to signAndGenerateBroadcastableTransaction so the RecoverNested instruction signer and the signing path are both correct for MPCv2 wallets. Add unit tests for MPCv2 keycard routing, MPCv1 regression, mismatched bitgoKey, and missing address validation. Ticket: WCI-495 Session-Id: 342e5b05-4d0f-487f-8709-7f2d871de396 Task-Id: 69cf21d5-0fa2-4660-83d9-7a4f6b417906
3637d31 to
bc52daa
Compare
What
recoverNestedAtato detect MPCv2 keycards usingisEddsaMpcV1SigningMaterialderiveUnhardenedMpsfor MPCv2 wallets instead ofMPC.deriveUnhardened, ensuring theRecoverNestedinstruction signer is correctisMpcV2flag tosignAndGenerateBroadcastableTransaction(added in WCI-494) so signing follows the MPCv2 pathbitgoKeyvs keycardcommonKeyChain, and missing address validationWhy
recoverNestedAtapreviously only supported MPCv1. For MPCv2 wallets, the wallet root address was derived with the wrong algorithm (MPC.deriveUnhardenedinstead ofderiveUnhardenedMps), causing theRecoverNestedinstruction to use an invalid signer address — the transaction would be rejected even before signingTest plan
recoverNestedAtaMPCv2 keycard — uses MPS-derived wallet address, does not callgetTSSSignaturerecoverNestedAtaMPCv1 keycard regression — usesMPC.deriveUnhardened, callsgetTSSSignatureoncerecoverNestedAtamismatchedbitgoKeyvs keycard — throws'EdDSA MPCv2 recovery: commonKeyChain from keycard does not match bitgoKey'nestedAtaAddress— throws'invalid nestedAtaAddress'ownerAtaAddress— throws'invalid ownerAtaAddress'Ticket: WCI-495