Skip to content

feat(wasm-utxo)!: add legacy transaction to PSBT conversion#210

Merged
OttoAllmendinger merged 2 commits intomasterfrom
BTC-2976.hydrate-from-legacy
Mar 16, 2026
Merged

feat(wasm-utxo)!: add legacy transaction to PSBT conversion#210
OttoAllmendinger merged 2 commits intomasterfrom
BTC-2976.hydrate-from-legacy

Conversation

@OttoAllmendinger
Copy link
Contributor

Add bidirectional conversion between half-signed legacy transactions
and PSBTs with transaction introspection API. Extract shared
transaction and PSBT properties into ITransactionCommon interface.

BREAKING CHANGE: version and lockTime are now methods instead of
getters. Update code from tx.version to tx.version() and
tx.lockTime to tx.lockTime().

  • Add fromHalfSignedLegacyTransaction() to convert legacy txs to PSBT
  • Extract partial sigs from scriptSig/witness in unsign_legacy_input()
  • Expose input/output accessors on Transaction/ZcashTransaction/DashTransaction
  • Add getInputs(), getOutputs(), getOutputsWithAddress() methods
  • Include version, lockTime, input/output counts
  • Export HydrationUnspent type for legacy conversion
  • Extract ITransactionCommon interface to reduce duplication
  • Convert version and lockTime from getters to methods
  • Add comprehensive round-trip tests for p2sh, p2shP2wsh, p2wsh

Issue: BTC-2976

OttoAllmendinger and others added 2 commits March 16, 2026 15:05
Add bidirectional conversion between half-signed legacy transactions
and PSBTs. Implement transaction introspection API for accessing
inputs, outputs, and metadata across all transaction types.

- Add `fromHalfSignedLegacyTransaction()` to convert legacy txs to PSBT
- Extract partial sigs from scriptSig/witness in `unsign_legacy_input()`
- Expose input/output accessors on Transaction/ZcashTransaction/DashTransaction
- Add `getInputs()`, `getOutputs()`, `getOutputsWithAddress()` methods
- Include version, lockTime, input/output counts
- Export `HydrationUnspent` type for legacy conversion
- Add comprehensive round-trip tests for p2sh, p2shP2wsh, p2wsh

Co-authored-by: llm-git <llm-git@ttll.de>
BREAKING CHANGE: version and lockTime are now methods instead of
getters. Update code from `tx.version` to `tx.version()` and
`tx.lockTime` to `tx.lockTime()`.

Extract shared transaction and PSBT properties into ITransactionCommon
interface to reduce duplication between ITransaction and IPsbt.
Convert version and lockTime from getters to methods for consistency
with other interface methods.

Issue: BTC-2976

Co-authored-by: llm-git <llm-git@ttll.de>
@OttoAllmendinger OttoAllmendinger marked this pull request as ready for review March 16, 2026 14:17
@OttoAllmendinger OttoAllmendinger requested a review from a team as a code owner March 16, 2026 14:17
@OttoAllmendinger OttoAllmendinger merged commit be58af4 into master Mar 16, 2026
13 checks passed
@OttoAllmendinger OttoAllmendinger deleted the BTC-2976.hydrate-from-legacy branch March 16, 2026 14:41
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.

2 participants