Skip to content

Conversation

@lcovar
Copy link
Contributor

@lcovar lcovar commented Jan 8, 2026

When utxo-lib serializes a Zcash PSBT, the ZecConsensusBranchId proprietary
key ends up in the raw unknown map rather than the parsed proprietary
map when deserialized by rust-bitcoin. This caused KeyNotFound errors
during signing when using wasm-utxo with PSBTs created by utxo-lib.

Modified get_zec_consensus_branch_id() to check both maps:

  1. First check the proprietary map (where wasm-utxo stores it)
  2. Fall back to the unknown map (where utxo-lib stores it)

The unknown map lookup uses rust-bitcoin's raw::Key struct fields:

  • type_value: 0xfc (proprietary key type)
  • key: [0x05, 'B', 'I', 'T', 'G', 'O', 0x00] (varint len + identifier + subtype)

This is a temporary workaround while BitGoJS uses a mix of utxo-lib and
wasm-utxo for Zcash PSBT operations.

Ticket: BTC-2917

@lcovar lcovar requested a review from a team as a code owner January 8, 2026 19:04
@OttoAllmendinger OttoAllmendinger self-requested a review January 8, 2026 19:52
When utxo-lib serializes a Zcash PSBT, the ZecConsensusBranchId proprietary
key ends up in the raw `unknown` map rather than the parsed `proprietary`
map when deserialized by rust-bitcoin. This caused KeyNotFound errors
during signing when using wasm-utxo with PSBTs created by utxo-lib.

Modified get_zec_consensus_branch_id() to check both maps:
1. First check the `proprietary` map (where wasm-utxo stores it)
2. Fall back to the `unknown` map (where utxo-lib stores it)

The unknown map lookup uses rust-bitcoin's raw::Key struct fields:
- type_value: 0xfc (proprietary key type)
- key: [0x05, 'B', 'I', 'T', 'G', 'O', 0x00] (varint len + identifier + subtype)

This is a temporary workaround while BitGoJS uses a mix of utxo-lib and
wasm-utxo for Zcash PSBT operations.

Ticket: BTC-2917
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.

3 participants