Skip to content

feat(wasm-utxo): expose consensusBranchId and branchIdForHeight on ZcashBitGoPsbt#295

Closed
OttoAllmendinger wants to merge 1 commit into
masterfrom
otto/T1-3519-zec-nu62-branch-id
Closed

feat(wasm-utxo): expose consensusBranchId and branchIdForHeight on ZcashBitGoPsbt#295
OttoAllmendinger wants to merge 1 commit into
masterfrom
otto/T1-3519-zec-nu62-branch-id

Conversation

@OttoAllmendinger

Copy link
Copy Markdown
Contributor

Summary

  • Adds consensus_branch_id() to the wasm_bindgen BitGoPsbt impl (Zcash variant only; returns None for non-ZEC PSBTs)
  • Adds zcash_branch_id_for_height() standalone wasm_bindgen free function wrapping the existing Rust branch_id_for_height function
  • TypeScript ZcashBitGoPsbt gains:
    • consensusBranchId: number | undefined — reads the branch ID stored in the PSBT proprietary map
    • static branchIdForHeight(network, height): number | undefined — returns the active consensus branch ID 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. Enables CSHLD-1013 / T1-3519 fix in ims-utxo.

Test plan

  • cargo test — all 448 tests pass
  • cargo fmt --check / cargo clippy — clean

🤖 Generated with Claude Code

@linear-code

linear-code Bot commented Jun 17, 2026

Copy link
Copy Markdown

T1-3519

…ashBitGoPsbt

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()
wasm_bindgen free function wrapping the existing branch_id_for_height Rust
function.

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-nu62-branch-id branch from 2b4cf02 to 91f5117 Compare June 17, 2026 10:26
@OttoAllmendinger

Copy link
Copy Markdown
Contributor Author

Superseded by a new PR with improved network validation in zcash_branch_id_for_height.

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.

1 participant