BIP174: Deduplicate type definitions by introducing registry file #2135

pull murchandamus wants to merge 4 commits into bitcoin:master from murchandamus:2026-04-08-deduplicate-psbt-tables changing 2 files +284 −435
  1. murchandamus commented at 10:33 PM on April 8, 2026: member

    So far, each BIP defining new PSBT types or fields has included the new definitions both in its own BIP text and then replicated them in BIP174. This violates the Single Source of Truth paradigm and presents an obvious vector for mismatching information across BIPs. This PR proposes to make each BIP the sole authoritative source for the PSBT fields and types it introduces and extracts only the Name, keytype, and "Parent BIP" columns from BIP174 to a registry file that tracks all existing definitions to prevent clashes.

    This PR builds on BIP376’s #2089 which is anticipated to be published soon, and will be rebased thereafter.

  2. murchandamus added the label Proposed BIP modification on Apr 8, 2026
  3. murchandamus added the label Pending acceptance on Apr 8, 2026
  4. murchandamus force-pushed on Apr 8, 2026
  5. murchandamus force-pushed on Apr 8, 2026
  6. murchandamus marked this as a draft on Apr 8, 2026
  7. achow101 commented at 10:41 PM on April 8, 2026: member

    Copncept ACK

  8. murchandamus removed the label Pending acceptance on Apr 9, 2026
  9. in bip-0174.mediawiki:557 in d87c733821


    nymius commented at 1:06 PM on April 9, 2026:

    These lines conflict with the proposal.


    nymius commented at 1:08 PM on April 9, 2026:

    This line conflicts with the proposal.

  10. nymius commented at 1:09 PM on April 9, 2026: contributor

    Concept ACK

    From the specification perspective this is less prone to errors. On the other side, I think I'm still going to paste all the fields in a single table when checking implementations. But there is no reason for it to be done in this repository.

  11. murchandamus commented at 10:39 PM on April 9, 2026: member

    Thanks for the review @nymius, I’ll update when #2089 is published.

  12. BIP174: Deduplicate global type definitions 762e8c785b
  13. BIP174: Deduplicate input type definitions d71cd39f69
  14. BIP174: Deduplicate per-output type definitions 0a23dbf56a
  15. 174: Add changelog and version number d6ff1bec1d
  16. murchandamus force-pushed on Apr 13, 2026
  17. murchandamus commented at 3:16 PM on April 13, 2026: member

    I rebased this PR on the latest master after BIP 376 is now published per #2089.

    Changes:

    • Update the two sentences pointed out by @nymius to refer to the auxiliary file instead of the Specification
    • Touch-up the formatting of auxiliary registry table file
  18. murchandamus marked this as ready for review on Apr 13, 2026
  19. murchandamus requested review from achow101 on Apr 14, 2026
  20. murchandamus requested review from nymius on Apr 14, 2026
  21. guggero commented at 10:50 AM on April 14, 2026: contributor

    ACK d6ff1bec1d669fafd955f5d2aa4b4beeeab90e0a Removes duplication and makes it easier to see all types at a glance.

  22. nymius commented at 12:02 PM on April 14, 2026: contributor

    ACK d6ff1bec1d669fafd955f5d2aa4b4beeeab90e0a

    A changelog is sneaking here too, good addition.

  23. jonatack commented at 3:44 PM on April 14, 2026: member

    Concept ACK, nice cleanup

  24. in bip-0174/type-registry.mediawiki:86 in d6ff1bec1d
      81 | +|-
      82 | +| Witness Script
      83 | +| <tt>PSBT_IN_WITNESS_SCRIPT = 0x05</tt>
      84 | +| [[bip-0174.mediawiki|174]]
      85 | +|-
      86 | +| BIP 32 Derivation Path
    


    jonatack commented at 3:57 PM on April 14, 2026:

    Pico-nit, with SHA256, RIPEMD160, HASH256, etc, written without a space separator, might be better here in the same table to write BIP 32 (and the other BIP citations) as BIP32 (also without a space separator). Feel free to ignore.


    achow101 commented at 10:50 PM on April 14, 2026:

    Hash names do not have spaces, they are generally hyphenated or without a separator. Personally, I do not use a separator for hash names, and always use a space between BIP and a number. This is consistent throughout my writings and I'd prefer that style to remain unchanged.

  25. in bip-0174.mediawiki:168 in d6ff1bec1d
     162 | -| Transaction Modifiable Flags
     163 | -| <tt>PSBT_GLOBAL_TX_MODIFIABLE = 0x06</tt>
     164 | -| None
     165 | -| No key data
     166 | -| <tt><8-bit uint flags></tt>
     167 | -| An 8 bit little endian unsigned integer as a bitfield for various transaction modification flags. Bit 0 is the Inputs Modifiable Flag and indicates whether inputs can be modified. Bit 1 is the Outputs Modifiable Flag and indicates whether outputs can be modified. Bit 2 is the Has SIGHASH_SINGLE flag and indicates whether the transaction has a SIGHASH_SINGLE signature who's input and output pairing must be preserved. Bit 2 essentially indicates that the Constructor must iterate the inputs to determine whether and how to add an input.
    


    jonatack commented at 4:03 PM on April 14, 2026:

    Echoing the PR description, in case a reviewer of this change wonders if we're losing information by removing text like this: the text already exists in the parent BIP, in this case, BIP370.

  26. in bip-0174.mediawiki:590 in d6ff1bec1d
     585 | +
     586 | +* '''1.4.2''' (2026-04-08):
     587 | +** Introduce type registry auxiliary file
     588 | +** Add changelog
     589 | +* '''1.4.1''' (2021-01-14):
     590 | +** Mark Final
    


    jonatack commented at 4:11 PM on April 14, 2026:

    Per BIP3, statuses are now one of Draft | Complete | Deployed | Closed.


    achow101 commented at 10:50 PM on April 14, 2026:

    The changelog reflects the status as it existed at the time of the change.


    murchandamus commented at 1:34 AM on April 15, 2026:

    On second thought, it might be confusing to future readers when it says Final, if they don’t know about the history of BIP3.

    Perhaps it would be good if it said "Mark Final (later updated to Deployed with the Deployment of BIP3)". I was planning on adding Changelogs to Closed, Complete, and Deployed BIPs that don’t have any, also especially to record the reasons why BIPs are Closed, so I’ll probably update it then, if nobody else beats me to it.


    murchandamus commented at 3:33 PM on April 15, 2026:

    I opened a follow-up to address this: https://github.com/bitcoin/bips/pull/2143

  27. achow101 commented at 10:51 PM on April 14, 2026: member

    ACK d6ff1bec1d669fafd955f5d2aa4b4beeeab90e0a

  28. murchandamus merged this on Apr 15, 2026
  29. murchandamus closed this on Apr 15, 2026

  30. murchandamus commented at 12:20 AM on April 15, 2026: member

    Looks like the comments were resolved. Thanks for the review, @achow101, @nymius, @guggero, and @jonatack

  31. in bip-0174.mediawiki:589 in d6ff1bec1d
     580 | @@ -1005,6 +581,25 @@ able to be unserialized by an unserializer for the PSBT format.
     581 |  
     582 |  <img src="bip-0174/multisig-workflow.svg" align="middle"></img>
     583 |  
     584 | +==Changelog==
     585 | +
     586 | +* '''1.4.2''' (2026-04-08):
     587 | +** Introduce type registry auxiliary file
     588 | +** Add changelog
     589 | +* '''1.4.1''' (2021-01-14):
    


    jonatack commented at 7:08 PM on April 15, 2026:

    Per semver (as well as consistency with the previous versioning here), 1.4.1 and 1.4.2 should probably be 1.5.0 and 1.6.0.

  32. in bip-0174/type-registry.mediawiki:12 in d6ff1bec1d
       7 | +! <tt><keytype></tt>
       8 | +! Parent BIP
       9 | +|-
      10 | +| Unsigned Transaction
      11 | +| <tt>PSBT_GLOBAL_UNSIGNED_TX = 0x00</tt>
      12 | +| [[bip-0174.mediawiki|174]]
    


    nymius commented at 12:28 PM on April 16, 2026:

    These are not being resolved as they should in master, e.g., https://github.com/bitcoin/bips/blob/master/bip-0174/bip-0370.mediawiki

    As this is placed inside bip-0174/ folder, it seems it expects all BIP files to live there. There is any sort of parent directory reference in mediawiki?


    murchandamus commented at 1:53 PM on April 16, 2026:

    Ah darn, it is probably being interpreted as a relative path and is missing a "../".


    murchandamus commented at 2:01 PM on April 16, 2026:

    I added a fix to #2143.


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-05-05 08:10 UTC

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