Skip to content

BIP174: Deduplicate type definitions by introducing registry file#2135

Open
murchandamus wants to merge 4 commits intobitcoin:masterfrom
murchandamus:2026-04-08-deduplicate-psbt-tables
Open

BIP174: Deduplicate type definitions by introducing registry file#2135
murchandamus wants to merge 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 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 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.

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

| <tt>PSBT_IN_WITNESS_SCRIPT = 0x05</tt>
| [[bip-0174.mediawiki|174]]
|-
| BIP 32 Derivation Path
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.

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.

| 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.

** Introduce type registry auxiliary file
** Add changelog
* '''1.4.1''' (2021-01-14):
** Mark Final
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.

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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants