Skip to content

feat(wasm-utxo): expose ZEC branch ID APIs on ZcashBitGoPsbt#296

Merged
OttoAllmendinger merged 1 commit into
masterfrom
otto/T1-3519-zec-branch-id-apis
Jun 17, 2026
Merged

feat(wasm-utxo): expose ZEC branch ID APIs on ZcashBitGoPsbt#296
OttoAllmendinger merged 1 commit into
masterfrom
otto/T1-3519-zec-branch-id-apis

Conversation

@OttoAllmendinger

Copy link
Copy Markdown
Contributor

Adds consensus_branch_id() to the #[wasm_bindgen] impl BitGoPsbt (Zcash variant only; returns None for non-ZEC PSBTs). Adds a zcash_branch_id_for_height() free function that wraps the existing Rust branch_id_for_height, returning a Result so it throws on unrecognised network strings — only "zcash"/"zec" (mainnet) and "zcashTest"/"tzec" (testnet) are accepted.

TypeScript ZcashBitGoPsbt gains:

  • consensusBranchId: number | undefined — reads the branch ID from the PSBT proprietary map (absent for v5 or non-ZEC PSBTs)
  • static branchIdForHeight(network, height): number | undefined — returns the consensus branch ID active at a given chain height

These APIs let callers (e.g. ims-utxo parse path) validate a PSBT's consensus branch ID against the current chain height without importing @bitgo-beta/utxo-lib.

Refs: T1-3519

@linear-code

linear-code Bot commented Jun 17, 2026

Copy link
Copy Markdown

T1-3519

Adds consensus_branch_id() to the wasm_bindgen BitGoPsbt impl (Zcash
variant only; returns None for non-ZEC PSBTs). Adds a
zcash_branch_id_for_height() free function wrapping the existing Rust
branch_id_for_height, returning a Result so it throws on unrecognised
network strings ("zcash"/"zec" for mainnet, "zcashTest"/"tzec" for
testnet — anything else is an error).

TypeScript ZcashBitGoPsbt gains:
  consensusBranchId: number | undefined — reads the branch ID stored in
    the PSBT proprietary map (absent for v5 or non-ZEC PSBTs).
  static branchIdForHeight(network, height): number | undefined — returns
    the consensus branch ID active at a given chain height.

These APIs allow callers (e.g. ims-utxo parse path) to validate a PSBT's
consensus branch ID against the current chain height without importing
@bitgo-beta/utxo-lib.

Refs: T1-3519
@OttoAllmendinger OttoAllmendinger force-pushed the otto/T1-3519-zec-branch-id-apis branch from e307330 to e9371ee Compare June 17, 2026 12:48
@OttoAllmendinger OttoAllmendinger changed the base branch from master to otto/T1-3598-bump-zebra-chain June 17, 2026 12:49
Base automatically changed from otto/T1-3598-bump-zebra-chain to master June 17, 2026 13:03
@OttoAllmendinger OttoAllmendinger marked this pull request as ready for review June 17, 2026 13:03
@OttoAllmendinger OttoAllmendinger requested a review from a team as a code owner June 17, 2026 13:03
@OttoAllmendinger OttoAllmendinger merged commit 1d5845f into master Jun 17, 2026
17 checks passed
@OttoAllmendinger OttoAllmendinger deleted the otto/T1-3519-zec-branch-id-apis branch June 17, 2026 14:46
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