Skip to content

Reject trailing data in PSBT global unsigned transactions - #1327

Open
KY-U wants to merge 1 commit into
MetacoSA:masterfrom
KY-U:2026-08-fix-psbt-v0
Open

Reject trailing data in PSBT global unsigned transactions#1327
KY-U wants to merge 1 commit into
MetacoSA:masterfrom
KY-U:2026-08-fix-psbt-v0

Conversation

@KY-U

@KY-U KY-U commented Aug 7, 2026

Copy link
Copy Markdown

This PR makes PSBTv0 parsing reject a PSBT_GLOBAL_UNSIGNED_TX value when transaction deserialization does not consume the entire declared value as per the BIP174:

All keys must have the data that they specify. If any key or value does not match the specified format for that type, the PSBT must be considered invalid.

It also explicitly parses the global unsigned transaction using legacy, non-witness transaction serialization, as required by the BIP.

The transaction in network serialization. The scriptSigs and witnesses for each input must be empty. The transaction must be in the old serialization format (without witnesses).

Parse PSBT_GLOBAL_UNSIGNED_TX using the legacy transaction format required
by BIP174 and ensure deserialization consumes the entire field value.

Add an invalid PSBT vector containing a valid transaction followed by
trailing data.
@KY-U KY-U changed the title fix(psbt): reject trailing data in global unsigned transactions Reject trailing data in PSBT global unsigned transactions Aug 7, 2026
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.

1 participant