feat(abstract-utxo): implement deriveAddress for fixed-script UTXO wallets#9018
Conversation
…llets Override BaseCoin.deriveAddress on AbstractUtxoCoin to locally derive a 2-of-3 multisig receive address from the xpub triple and a chain/index, delegating to the existing generateAddress used by the isWalletAddress verification path, so derive and verify can never diverge. Offline and key-material-free (public keys only). The chain code selects the script type (P2SH, P2WSH/bech32, P2TR) with an optional format override. Adds unit coverage for legacy P2SH (chain 0) and bech32 P2WSH (chain 20): derived address matches generateAddress, plus a derive->verify round-trip. WCN-915 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Claude finished @rajangarg047's task —— View job Code Review for deriveAddress ImplementationTodo List:
Overall Assessment ✅This is a well-implemented feature that adds Positive Aspects🎯 Excellent Design Decisions
📚 Clear Documentation
🧪 Solid Test Coverage
Technical Review✅ Implementation Quality (
|
Summary
Implements
deriveAddressonAbstractUtxoCoin(Stage B), overriding theBaseCoindefault. It locally derives a 2-of-3 multisig receive address from the xpub triple + chain/index, delegating to the existinggenerateAddressused by theisWalletAddressverification path — so derive and verify can never diverge. Offline and key-material-free (public keys only). Thechaincode selects the script type (P2SH, P2WSH/bech32, P2TR) with an optionalformatoverride.Context
FR-465 Phase 1, Stage B. Builds only on the merged primitive (WCN-912) — independent of the Express endpoint (WCN-914) and the other coin PRs. Per Bullish scope, tests focus on legacy P2SH (chain 0) and bech32 P2WSH (chain 20); Taproot is supported by
generateAddressfor free but not exercised in fixtures.Test plan
tsc --noEmitclean forabstract-utxoeslintclean (0 errors)deriveAddresstests pass: derived address matchesgenerateAddressfor P2SH (chain 0) and P2WSH (chain 20), derive→verify round-trip for both, and missing-keychains error.🤖 Generated with Claude Code