PSBTv2: Relax transaction version requirement #1431

pull bigspider wants to merge 1 commits into bitcoin:master from bigspider:psbtv2-fix-txversion changing 1 files +2 −2
  1. bigspider commented at 11:40 AM on March 4, 2023: contributor

    PSBTs with transaction version number less than 2 are valid for PSBTv0; therefore, mandating transaction version number 2 in a PSBTv2 implementation would create the situation where some valid PSBTv0 can't be converted to PSBTv2.

    By only mandating the transaction version to be at least 2 when the transaction is modifiable (that is, when Creator and Constructor roles are distinct), the issue is avoided.

    (h/t to @bucko13 for spotting the issue)

  2. Relax transaction version requirement when the Creator is also a Constructor. 5cf651155d
  3. Shadouts commented at 6:13 PM on March 6, 2023: contributor

    If the Creator is the Constructor and has validated that PSBTv2 locktime features are not required, then why not just construct a PSBTv0 instead? I would suggest that the simplest solution which doesn't add additional states or role validation would be for roles to check and support one, the other, or both versions as they are currently defined.

    While the PSBT versions themselves are compatible, I don't think that suggests they should be convertible from v0 to v2. A v0->v2 conversion would really be starting from the v2 Creator/Constructor role creating a new PSBTv2 (no sigs). Should that Constructor be replaying sigs created by a Signer for the PSBTv0 version of the transaction?

    If this change were added, there may need to be additional validation requirements per role clearly defined in addition to the GLOBAL_TX_MODIFIABLE flags.

  4. bitcoin deleted a comment on Mar 6, 2023
  5. achow101 commented at 6:40 PM on March 6, 2023: member

    If the Creator is the Constructor and has validated that PSBTv2 locktime features are not required, then why not just construct a PSBTv0 instead?

    Memory requirements for the parser, e.g. ledger requires v2 so it can directly ask for each field of the transaction instead of constantly re-parsing the v0 global tx which it doesn't have the memory to store.

    I don't think that suggests they should be convertible from v0 to v2. A v0->v2 conversion would really be starting from the v2 Creator/Constructor role creating a new PSBTv2 (no sigs).

    Why? Converting from v0 to v2 is a lossless conversion, no information is lost and the state of the transaction does not change. A PSBTv0 is inherently non-modifiable and modifying a PSBTv2 requires opt-in via the modifiable flags It just becomes a non-modifiable PSBTv2. Even with signatures, converting from v0 to v2 should not result in anything becoming invalid.

  6. achow101 commented at 6:44 PM on March 6, 2023: member

    ACK 5cf651155d8b7d2a53dd19084f299247ce03e5bc

  7. kallewoof merged this on Mar 8, 2023
  8. kallewoof closed this on Mar 8, 2023


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bips. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-28 17:10 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me