Repository navigation
CSHLD-2087: Route PA-creation input ids through wasm for v6 PSBTs - #454
Merged
Merged
Conversation
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
Ranjna-G
marked this pull request as ready for review
October 28, 2026 13:59
There was a problem hiding this comment.
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.
rakeshgsharma
approved these changes
Oct 28, 2026
Ranjna-G
enabled auto-merge
October 28, 2026 14:02
prajwalu142
approved these changes
Oct 28, 2026
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
Adds
get_input_outpointsto the PSBT wasm surface: each transparent input's previous-output outpoint, txid in display order. This is the wasm counterpart of utxo-lib's rawtxInputs+getOutputIdForInputintrospection, 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)(readsunsigned_tx.input[i].previous_output; pure, unit-testable) + theget_input_outpointswasm method on both macro-generated impls (BitGoPsbt + wrapped variants); a thin JsValue wrappersrc/wasm/psbt_ops.rs/src/wasm/mod.rs/src/wasm/try_into_js_value.rs— trait method, crate export, JsValue serializationjs/psbtBase.ts+js/index.ts—getInputOutpoints()wrapper and its typeinput_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 testnpx tsc --noEmit— 0 errors against regenerated bindingsnpx mocha test/fixedScript/zcashIronwoodPsbt.ts— all passing, including the new wrapper-level parity test