feat(wasm-utxo): expose consensusBranchId and branchIdForHeight on ZcashBitGoPsbt#295
Closed
OttoAllmendinger wants to merge 1 commit into
Closed
feat(wasm-utxo): expose consensusBranchId and branchIdForHeight on ZcashBitGoPsbt#295OttoAllmendinger wants to merge 1 commit into
OttoAllmendinger wants to merge 1 commit into
Conversation
…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
2b4cf02 to
91f5117
Compare
Contributor
Author
|
Superseded by a new PR with improved network validation in zcash_branch_id_for_height. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
consensus_branch_id()to thewasm_bindgenBitGoPsbtimpl (Zcash variant only; returnsNonefor non-ZEC PSBTs)zcash_branch_id_for_height()standalonewasm_bindgenfree function wrapping the existing Rustbranch_id_for_heightfunctionZcashBitGoPsbtgains:consensusBranchId: number | undefined— reads the branch ID stored in the PSBT proprietary mapstatic branchIdForHeight(network, height): number | undefined— returns the active consensus branch ID at a given chain heightThese 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 passcargo fmt --check/cargo clippy— clean🤖 Generated with Claude Code