feat(wasm-utxo)!: add legacy transaction to PSBT conversion#210
Merged
OttoAllmendinger merged 2 commits intomasterfrom Mar 16, 2026
Merged
feat(wasm-utxo)!: add legacy transaction to PSBT conversion#210OttoAllmendinger merged 2 commits intomasterfrom
OttoAllmendinger merged 2 commits intomasterfrom
Conversation
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>
davidkaplanbitgo
approved these changes
Mar 16, 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.
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.versiontotx.version()andtx.lockTimetotx.lockTime().fromHalfSignedLegacyTransaction()to convert legacy txs to PSBTunsign_legacy_input()getInputs(),getOutputs(),getOutputsWithAddress()methodsHydrationUnspenttype for legacy conversionIssue: BTC-2976