feat(abstract-eth): implement deriveAddress for MPC/TSS ETH wallets#9017
feat(abstract-eth): implement deriveAddress for MPC/TSS ETH wallets#9017rajangarg047 wants to merge 1 commit into
Conversation
Override BaseCoin.deriveAddress on AbstractEthLikeNewCoins to locally derive a receive address from the wallet's commonKeychain + index for MPC/TSS wallets (wallet versions 3, 5, 6), reusing the shared deriveMPCWalletAddress (secp256k1) helper plus KeyPair.getAddress() — the exact derivation isWalletAddress checks against, so derive and verify can never diverge. Offline and key-material-free (public keys only). Legacy BIP32 forwarder wallets (versions 1, 2, 4) throw a clear error and are handled in a separate ticket. Adds unit coverage (in sdk-coin-eth) asserting exact-match against the existing MPC test vector, a derive->verify round-trip, the forwarder-version guard, and the missing-keychains error. WCN-916 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Claude finished @rajangarg047's task —— View job Code Review for deriveAddress Implementation ✅Todo List:
Review SummaryThis is a solid, well-implemented addition that follows BitGoJS patterns and addresses the requirements clearly. The implementation correctly overrides ✅ Strengths1. Clean Implementation
2. Robust Error Handling
3. Security Considerations
4. Comprehensive Test CoverageThe test suite in
5. Documentation Quality
🔍 Code Quality ObservationsArchitecture Alignment
Type Safety
Error Handling Patterns
📋 Minor Observations (No Action Required)
🏆 Final AssessmentThis is excellent work that demonstrates:
The implementation correctly achieves the Stage A goals of FR-465 Phase 1, providing offline MPC address derivation that maintains cryptographic consistency with address verification. Ready for merge! 🚀 Job run: https://github.com/BitGo/BitGoJS/actions/runs/xyz |
Summary
Implements
deriveAddressonAbstractEthLikeNewCoinsfor MPC/TSS ETH wallets (Stage A), overriding theBaseCoindefault. It locally derives a receive address from the wallet'scommonKeychain+index, reusing the sharedderiveMPCWalletAddress(secp256k1) helper plusKeyPair.getAddress()— the exact derivationisWalletAddresschecks against, so derive and verify can never diverge.Offline and key-material-free (public keys only). Supports wallet versions 3, 5, 6; legacy BIP32 forwarder wallets (1, 2, 4) throw a clear error and are handled in a separate ticket (WCN-932).
Context
FR-465 Phase 1, Stage A. Builds only on the merged primitive (WCN-912) and shared MPC engine (WCN-913) — independent of the Express endpoint (WCN-914) and the other coin PRs.
Test plan
tsc --noEmitclean forabstract-ethandsdk-coin-etheslintclean (0 errors)deriveAddresstests (insdk-coin-eth) pass:commonKeychain@ index 0 →0x01153f3adfe454a72589ca9ef74f013c19e54961)🤖 Generated with Claude Code