CSHLD-1652: Build @bitgo/abstract-utxo to expose new ZEC address helper exports - #9668
CSHLD-1652: Build @bitgo/abstract-utxo to expose new ZEC address helper exports#9668abhi-bitgo wants to merge 1 commit into
Conversation
|
@claude review this pr |
|
Claude finished @abhi-bitgo's task —— View job PR Review: CSHLD-1652 - Build @bitgo/abstract-utxo to expose new ZEC address helper exportsOverview ✅This PR successfully extends Zcash address validation to support ZIP-316 Unified Addresses (shielded addresses) while maintaining backward compatibility with transparent addresses. The implementation is clean, well-documented, and thoroughly tested. Code Quality Analysis✅ Strengths:
Security Considerations ✅
Performance Considerations ✅
API Design ✅The new exported functions provide a clean, intuitive API:
Test Coverage ✅Excellent test coverage with realistic test vectors and edge cases. The tests verify both positive and negative cases across different networks and address types. Minor Suggestions:
Verdict: ✅ APPROVEThis is a well-implemented feature that safely extends Zcash address validation capabilities. The code follows BitGoJS patterns, maintains backward compatibility, and includes comprehensive testing. Ready to merge. Job Run: View workflow runs |
|
|
Zec.isValidAddress previously only accepted transparent (base58check) addresses. Extend it to also recognize well-formed ZIP-316 Unified Addresses (Sapling/Orchard), and expose standalone helpers (getZcashAddressKind, isShieldedZcashAddress, isValidZcashAddress) for callers that need to classify or validate addresses without a coin/SDK instance. Ticket: CSHLD-1652
23443de to
a822362
Compare
| */ | ||
| export function isShieldedZcashAddress(address: string, network: fixedScriptWallet.ZcashNetworkName): boolean { | ||
| try { | ||
| fixedScriptWallet.ZcashUnifiedAddress.parse(address, network); |
There was a problem hiding this comment.
Not all unified address are valid with respect to bitgo, only ones with orchard receiver are valid
Summary
Extends
Zec.isValidAddressto recognize well-formed ZIP-316 Unified Addresses (Sapling/Orchard) in addition to transparent addresses, and adds standalone helpers for classifying/validating Zcash addresses without needing a coin/SDK instance.Linear: CSHLD-1652
Changes
modules/abstract-utxo/src/impl/zec/address.ts(new):isShieldedZcashAddress,getZcashAddressKind,isValidZcashAddressmodules/abstract-utxo/src/impl/zec/zec.ts:Zec.isValidAddressnow falls back to shielded-address recognitionmodules/abstract-utxo/src/impl/zec/index.ts: re-export the new address modulemodules/abstract-utxo/test/unit/impl/zec/unit/address.ts(new): unit tests covering transparent/shielded/garbage/cross-network casesTest Plan
yarn unit-test --scope abstract-utxo(newaddress.tstest suite passes)tsc --noEmitandyarn lintclean