Skip to content

CSHLD-2087: Route PA-creation input ids through wasm for v6 PSBTs - #454

Merged
Ranjna-G merged 1 commit into
masterfrom
CSHLD-2087-input-outpoints-accessor
Oct 28, 2026
Merged

Ranjna-G merged 1 commit into
masterfrom
CSHLD-2087-input-outpoints-accessor

Conversation

@Ranjna-G

Copy link
Copy Markdown
Contributor

Summary

Adds get_input_outpoints to the PSBT wasm surface: each transparent input's previous-output outpoint, txid in display order. This is the wasm counterpart of utxo-lib's raw txInputs + getOutputIdForInput introspection, so consumers that only need the spent outpoints — unspent-id extraction, e.g. wallet-platform's pending-approval creation — behave identically for v4 and v6 PSBTs.

Linear: CSHLD-2087

Changes

  • src/wasm/psbt.rs — PsbtInputOutpoint {txid, vout} + input_outpoints(psbt) (reads unsigned_tx.input[i].previous_output; pure, unit-testable) + the get_input_outpoints wasm method on both macro-generated impls (BitGoPsbt + wrapped variants); a thin JsValue wrapper
  • src/wasm/psbt_ops.rs / src/wasm/mod.rs / src/wasm/try_into_js_value.rs — trait method, crate export, JsValue serialization
  • js/psbtBase.ts + js/index.ts — getInputOutpoints() wrapper and its type
  • Tests: Rust (input_outpoints_are_version_symmetric — the same mock outpoint spent by a v4 and a v6 PSBT yields the identical display-order {txid, vout}) and JS (the same assertion through the TS wrapper)

Why

wallet-platform's PA creation extracts input ids from the built transaction. For v6 PSBTs it routes through the wasm layer; the only wasm API that exposed outpoints was the wallet-key-aware parseTransactionWithWalletKeys. This accessor reads the same outpoints directly off the embedded unsigned transaction — the same data, in the same display-order shape utxo-lib's raw parse provides for v4 — with no wallet keys involved, matching v4 behavior.

Sequencing

wallet-platform consumes this once it releases (its bms counterpart branch is written against this API and bumps the pin in lockstep).

Test Plan

  • cargo test --lib — 765+ passing, including the new version-symmetry test
  • npx tsc --noEmit — 0 errors against regenerated bindings
  • npx mocha test/fixedScript/zcashIronwoodPsbt.ts — all passing, including the new wrapper-level parity test

Add get_input_outpoints to the PSBT wasm surface (BitGoPsbt and the
wrapped variants), returning each transparent input's previous-output
outpoint with the txid in display order — the wasm counterpart of
utxo-lib's raw txInputs + getOutputIdForInput introspection. Callers
that only need the spent outpoints (unspent-id extraction, e.g.
wallet-platform's PA-creation path) behave the same for v4 and v6
PSBTs.

Ticket: CSHLD-2087
@linear-code

linear-code Bot commented Oct 28, 2026

Copy link
Copy Markdown

CSHLD-2087

@Ranjna-G
Ranjna-G marked this pull request as ready for review October 28, 2026 13:59
@Ranjna-G
Ranjna-G requested review from a team as code owners October 28, 2026 13:59

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@Ranjna-G
Ranjna-G enabled auto-merge October 28, 2026 14:02
@Ranjna-G
Ranjna-G disabled auto-merge October 28, 2026 14:06
@Ranjna-G
Ranjna-G merged commit a8f845d into master Oct 28, 2026
14 checks passed
@Ranjna-G
Ranjna-G deleted the CSHLD-2087-input-outpoints-accessor branch October 28, 2026 14:06
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