Skip to content

BIP-110: Clarify P2A exemption in rule 3 requires an empty witness stack - #2225

Open
dathonohm wants to merge 2 commits into
bitcoin:masterfrom
dathonohm:bip110-p2a-clarification
Open

BIP-110: Clarify P2A exemption in rule 3 requires an empty witness stack#2225
dathonohm wants to merge 2 commits into
bitcoin:masterfrom
dathonohm:bip110-p2a-clarification

Conversation

@dathonohm

Copy link
Copy Markdown
Contributor

No description provided.

@jonatack jonatack left a comment

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.

@dathonohm This is less complete than #2218 that you have been obstructing.

@jonatack jonatack added the BIP Update by Owner PR by Author or Deputy to modify their own BIP label Jul 29, 2026
@dathonohm

Copy link
Copy Markdown
Contributor Author

@jonatack #2218 is incorrect and thus not acceptable. I can add the test vectors here if you wish, but I don't see the reason they are urgently needed. The clarification here should suffice, though I also do not concede that Rule 3 is incorrect prior to this change.

Comment thread bip-0110.mediawiki Outdated
@luke-jr

luke-jr commented Jul 29, 2026

Copy link
Copy Markdown
Member

Looks fine to me

@dathonohm

Copy link
Copy Markdown
Contributor Author

Added test vectors.

@murchandamus murchandamus left a comment

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.

Consensus rules should be clearly stated in the Specification section. The Rationale is not the right place for a singular mention of a consensus rule.

Comment thread bip-0110.mediawiki Outdated
@murchandamus

murchandamus commented Jul 29, 2026

Copy link
Copy Markdown
Member

Just to be clear: NACK ed0d033. This does not adequately address the issue that not all proposed changes to consensus rules are explicitly and comprehensively described in the Specification.

@john-moffett

Copy link
Copy Markdown
Contributor

NACK ed0d033. The description of P2A is imprecise and potentially misleading.

@dathonohm

Copy link
Copy Markdown
Contributor Author

Split "Defined witness versions" into its own subsection. This format should be much harder to misinterpret.

@murchandamus murchandamus left a comment

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.

Thanks, looks good. The first commit is now obsolete, since it only makes changes that are superseded again by the third commit, so you could drop it. Otherwise ACK 3553edb.

Comment thread bip-0110.mediawiki
@dathonohm
dathonohm force-pushed the bip110-p2a-clarification branch from 3553edb to 2dfb201 Compare July 29, 2026 20:53
@dathonohm

Copy link
Copy Markdown
Contributor Author

@murchandamus replaced commit 1 with commit 3; contents are identical to before.

Comment thread bip-0110.mediawiki
Comment thread bip-0110.mediawiki

* '''Witness v0''' with a 20-byte program (P2WPKH) or a 32-byte program (P2WSH), as defined in [[bip-0141.mediawiki|BIP 141]]. Other v0 program lengths are already invalid under BIP 141 itself.
* '''Witness v1''' with a 32-byte program (Taproot/P2TR), as defined in [[bip-0341.mediawiki|BIP 341]]. In a script path spend, the only defined Tapleaf version is 0xc0 (Tapscript), as defined in [[bip-0342.mediawiki|BIP 342]].
* '''Witness v1''' with the 2-byte program 0x4e73 (P2A), and only when spent with an empty witness stack, as defined in [[bip-0433.mediawiki#specification|BIP 433]].

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I'm all for appeasing the author, as long as it's a clear win for documentations spec, integrity, and a win for implementers of this bip.

But the author is stating here, as written, that bip433 states a p2a must be spent with an empty witness, which is incorrect.

All attempts around the 8th rule, point to this being a clear isolatable consensus rule imposed by bip110

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

But the author is stating here, as written, that bip433 states a p2a must be spent with an empty witness

That is indeed what it says:

"P2A inputs are considered standard by Bitcoin Core for spending if no witness data is attached."
Screenshot 2026-07-29 at 15 25 06

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

"Consensus meaning is unchanged"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We've been over this; "Consensus meaning is unchanged" just means that P2A has no consensus meaning at all. That isn't relevant to BIP-110.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2A output type specifically states that no witness data is attached.
If witness data is attached to the above specification, can it still be considered P2A? @jarolrod

@john-moffett john-moffett Jul 30, 2026

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.

@delcin-raj

P2A output type specifically states that no witness data is attached.

The output type is defined independently of the spend. It's a template, just like P2MS or P2PKH. Spending a P2A with witness data is currently consensus valid. The current relay policy, however, restricts it to an empty witness.

If witness data is attached to the above specification, can it still be considered P2A?

Undoubtedly, as BIP 433 is unequivocal in its definition of P2A: it's the output type, not the separate policy restricting its spend. In Bitcoin Core, IsPayToAnchor only looks at the scriptPubKey. It's like asking whether a 6-of-12 P2MS is still considered a P2MS despite it not relaying in Bitcoin Core due to policy. The answer is yes.

Edit: to address @dathonohm 's objection about "P2A has no consensus meaning at all". That's not true. The script pattern had existing consensus meaning before P2A (anyone can spend even with a non-empty witness), just like P2MS's script pattern had existing consensus meaning before BIP11 made it a standard template (and also didn't change any consensus rules).

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.

@delcin-raj Moreover, this PR itself also characterizes P2A by the output type, not the spending witness status.

"description": "Spend a PRE-activation P2A output with a non-empty witness stack (grandfathered, exempt)",

@murchandamus

Copy link
Copy Markdown
Member

I second that the phrasing suggested by @john-moffett would be an improvement. I also agree that a version bump would be appropriate, although I could live with something less than a major bump, given the authors’ stance this is just a clarification to an already correct specification.

That said, 2dfb201 resolves my main concern that the consensus rules should be documented in the specification.

@dathonohm

Copy link
Copy Markdown
Contributor Author

@murchandamus I decline to update the wording. It is correct as is. I don't think a version bump is required since the spec was only clarified, not changed, and no prior clarifications of the spec are listed in the changelog either.

@john-moffett

john-moffett commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

NACK 2dfb201. The description of P2A continues to be imprecise and potentially misleading.

@jarolrod

Copy link
Copy Markdown

I don't want to necessarily get in the way of bip maintainers here as this is becoming a giant time and attention sink, but politely, it would be a disservice to bip433 to allow for the misrepresentation of its contents here.

@swoopsus

Copy link
Copy Markdown

On the BIP-433 attribution — the quoted sentence is one of three in that Specification paragraph, and the two that follow are the ones in dispute:

P2A inputs are considered standard by Bitcoin Core for spending if no witness data is attached. This avoids meaningless witness padding. Consensus meaning is unchanged.

Read whole, that is a standardness claim scoped explicitly to Bitcoin Core, immediately followed by a statement that consensus is unaffected. @instagibbs has confirmed in #2218 that those following sentences exist precisely to prevent the reading being applied here: "It's meant to precisely guard against a mis-reading of it to think that P2A spends cannot have witness data."

So the empty-witness requirement is BIP-110's, not BIP-433's — which is all the line needs to say: "...and only when spent with an empty witness stack. P2A is defined in BIP 433; this witness restriction is imposed by this proposal." That attributes each requirement to the document that imposes it and doesn't require conceding anything about rule numbering.

On the version: if the specification was only clarified and not changed, an implementation built from v1.0.0 alone would already pass the test vectors added in 2dfb201. If it would not, the text changed what implementers build. BIP 3 puts an incompatible specification change at MAJOR, and @murchandamus has offered to accept less. Declining any increment leaves implementers to detect this by diffing the file.

@murchandamus

Copy link
Copy Markdown
Member

@murchandamus I decline to update the wording. It is correct as is. I don't think a version bump is required since the spec was only clarified, not changed, and no prior clarifications of the spec are listed in the changelog either.

It’s unclear to me why you continue to insist on making determinations about the meaning of another BIP, especially one that is so abundantly clear in its phrasing. @john-moffett’s suggestion is a neutral phrasing that sidesteps this unnecessary conflict and clarifies how BIP 110 is implemented correctly without the need to evaluate the meaning of BIP 433. I have already conceded (charitably, if I may say so) to entertain that the existing phrasing of BIP 110 implies the new proposed phrasing.

Anyway, these two PRs are becoming a huge distraction. I’m gonna take another look later this week.

@dathonohm

dathonohm commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

@murchandamus I agree. I think the current phrasing, "Witness v1 with the 2-byte program 0x4e73 (P2A), and only when spent with an empty witness stack, as defined in BIP 433" is not incorrect or misleading in any way. BIP-433 objectively contains text about requiring an empty witness.

@8144225309

Copy link
Copy Markdown

NACK 2dfb201

@delcin-raj

Copy link
Copy Markdown

ACK

arturkokurc1-prog

This comment was marked as spam.

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

Labels

BIP Update by Owner PR by Author or Deputy to modify their own BIP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants