Skip to content

feat(abstract-utxo): add zec shielded psbt decode and recipient resolution support - #9642

Open
veetragjain wants to merge 1 commit into
masterfrom
veetragjain/cshld-1639-resolve-zec-unified-address-recipients-for-shielding
Open

feat(abstract-utxo): add zec shielded psbt decode and recipient resolution support#9642
veetragjain wants to merge 1 commit into
masterfrom
veetragjain/cshld-1639-resolve-zec-unified-address-recipients-for-shielding

Conversation

@veetragjain

@veetragjain veetragjain commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Ticket: CSHLD-1640

@linear-code

linear-code Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

CSHLD-1639

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

⚠️ Unit tests are failing on Node 26.x (Current release line, non-blocking). This is not an LTS version yet, so it does not block merge, but it signals an incompatibility to fix before Node 26.x becomes LTS.

View run

@veetragjain
veetragjain force-pushed the veetragjain/cshld-1639-resolve-zec-unified-address-recipients-for-shielding branch from 17cba91 to c0b5ca0 Compare September 4, 2026 19:47
@veetragjain
veetragjain force-pushed the veetragjain/cshld-1639-resolve-zec-unified-address-recipients-for-shielding branch from c0b5ca0 to d3a9a4f Compare September 4, 2026 19:50
@veetragjain veetragjain changed the title feat(abstract-utxo): support shielding transaction build and decode feat(abstract-utxo): add zec shielded psbt decode and recipient resolution support Sep 4, 2026
@veetragjain
veetragjain marked this pull request as ready for review September 7, 2026 10:00
@veetragjain
veetragjain requested review from a team as code owners September 7, 2026 10:00
Comment on lines +63 to +68
/**
* Custom change wallet xpubs, when the transaction spends to a custom change wallet. Outputs
* matching these keys are classified as change, not recipients — matching how
* `explainPsbtWasm` treats them.
*/
customChangeXpubs?: Triple<string>;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need to support custom change wallets, let's leave this unimplemented and fail hard if a custom change wallet is configured

try {
return fixedScriptWallet.ZcashUnifiedAddress.parse(address, network);
} catch (e) {
return undefined;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should prefer failing hard instead

address: string,
param?: { anyFormat?: boolean; allowLightning?: boolean } | boolean
): boolean {
const unifiedAddress = tryParseUnifiedAddress(address, this.name as 'zec' | 'tzec');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems to be the only site where we use the undefined returning func, I'd rather inline the catch here

// `ZcashBitGoPsbt.fromBytes` signals v6 (Ironwood) bytes with a plain Error (not a
// WasmUtxoError) telling the caller to use `ZcashIronwoodBitGoPsbt.fromBytes` instead —
// see its doc comment. Fall back for that message as well as wasm-layer errors.
if (isWasmUtxoError(e) || (e instanceof Error && e.message.includes('v6 (Ironwood)'))) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a brittle way to identify errors. We have a more structured system for categorizing errors in wasm-utxo already, please check if we can already use it. If not, submit a change for wasm-utxo so we have a proper error code here instead and let's fix it in a follow-up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants