Skip to content

BIP174: Deduplicate type definitions by introducing registry file#2135

Merged
murchandamus merged 4 commits intobitcoin:masterfrom
murchandamus:2026-04-08-deduplicate-psbt-tables
Apr 15, 2026
Merged

BIP174: Deduplicate type definitions by introducing registry file#2135
murchandamus merged 4 commits intobitcoin:masterfrom
murchandamus:2026-04-08-deduplicate-psbt-tables

Conversation

@murchandamus
Copy link
Copy Markdown
Member

@murchandamus murchandamus commented Apr 8, 2026

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.

@murchandamus murchandamus added Proposed BIP modification PR by non-owner to update BIP content Pending acceptance This BIP modification requires sign-off by the champion of the BIP being modified labels Apr 8, 2026
@murchandamus murchandamus force-pushed the 2026-04-08-deduplicate-psbt-tables branch 2 times, most recently from 210088c to 3070d4b Compare April 8, 2026 22:40
@murchandamus murchandamus marked this pull request as draft April 8, 2026 22:41
@achow101
Copy link
Copy Markdown
Member

achow101 commented Apr 8, 2026

Copncept ACK

@murchandamus murchandamus removed the Pending acceptance This BIP modification requires sign-off by the champion of the BIP being modified label Apr 9, 2026
Copy link
Copy Markdown
Contributor

@nymius nymius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread bip-0174.mediawiki Outdated
Comment on lines 556 to 557
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines conflict with the proposal.

Comment thread bip-0174.mediawiki Outdated
Copy link
Copy Markdown
Contributor

@nymius nymius Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line conflicts with the proposal.

@murchandamus
Copy link
Copy Markdown
Member Author

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

@murchandamus murchandamus force-pushed the 2026-04-08-deduplicate-psbt-tables branch from d87c733 to d6ff1be Compare April 13, 2026 15:13
@murchandamus
Copy link
Copy Markdown
Member Author

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

@murchandamus murchandamus marked this pull request as ready for review April 13, 2026 15:16
@murchandamus murchandamus requested review from achow101 and nymius April 14, 2026 00:11
@guggero
Copy link
Copy Markdown
Contributor

guggero commented Apr 14, 2026

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

Copy link
Copy Markdown
Contributor

@nymius nymius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK d6ff1be

A changelog is sneaking here too, good addition.

@jonatack
Copy link
Copy Markdown
Member

Concept ACK, nice cleanup

Comment thread bip-0174/type-registry.mediawiki
Comment thread bip-0174.mediawiki
| None
| No key data
| <tt><8-bit uint flags></tt>
| 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.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread bip-0174.mediawiki
@achow101
Copy link
Copy Markdown
Member

ACK d6ff1be

@murchandamus murchandamus merged commit 5884318 into bitcoin:master Apr 15, 2026
4 checks passed
@murchandamus
Copy link
Copy Markdown
Member Author

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

Comment thread bip-0174.mediawiki
* '''1.4.2''' (2026-04-08):
** Introduce type registry auxiliary file
** Add changelog
* '''1.4.1''' (2021-01-14):
Copy link
Copy Markdown
Member

@jonatack jonatack Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

|-
| Unsigned Transaction
| <tt>PSBT_GLOBAL_UNSIGNED_TX = 0x00</tt>
| [[bip-0174.mediawiki|174]]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a fix to #2143.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Proposed BIP modification PR by non-owner to update BIP content

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants