Skip to content

Fix BIP143 standardness rules for CHECKMULTISIG - #33759

Closed
roconnor-blockstream wants to merge 1 commit into
bitcoin:masterfrom
roconnor-blockstream:bip143-standardness-2025-10
Closed

roconnor-blockstream wants to merge 1 commit into
bitcoin:masterfrom
roconnor-blockstream:bip143-standardness-2025-10

Conversation

@roconnor-blockstream

Copy link
Copy Markdown
Contributor

From https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki#restrictions-on-public-key-type

As a default policy, only compressed public keys are accepted in P2WPKH and
P2WSH. Each public key passed to a sigop inside version 0 witness program must
be a compressed key: the first byte MUST be either 0x02 or 0x03, and the size
MUST be 33 bytes. Transactions that break this rule will not be relayed or mined
by default.

PR #8499 's implemenation is insufficent to meet BIP143's requirements as it only checks those pubkeys processed by CHECKMULTISIG, whereas BIP143 requires that every public key passed to the CHECKMULTISIG be validated.

Note: these restrictions are policy only and not consensus rules.

@DrahtBot

DrahtBot commented Nov 1, 2025 •

Copy link
Copy Markdown
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage & Benchmarks

For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/33759.

Reviews

See the guideline for information on the review process.

Type Reviewers
Concept NACK ajtowns, billymcbip

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #33755 (Relax standardness rules regarding CHECKMULTISIG by roconnor-blockstream)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

From https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki#restrictions-on-public-key-type

> As a default policy, only compressed public keys are accepted in P2WPKH and
> P2WSH. Each public key passed to a sigop inside version 0 witness program must
> be a compressed key: the first byte MUST be either 0x02 or 0x03, and the size
> MUST be 33 bytes. Transactions that break this rule will not be relayed or mined
> by default.

PR bitcoin#8499 's implemenation is insufficent to meet BIP143's requirements as it
only checks those pubkeys processed by CHECKMULTISIG, whereas BIP143 requires
that every public key passed to the CHECKMULTISIG be validated.

Note: these restrictions are policy only and not consensus rules.
@roconnor-blockstream
roconnor-blockstream force-pushed the bip143-standardness-2025-10 branch from e203010 to 5ea1ea8 Compare November 3, 2025 20:26
@ajtowns

ajtowns commented Nov 3, 2025

Copy link
Copy Markdown
Contributor

Concept NACK. This doesn't seem like a productive use of anyone's time? "passed to a sigop" is at most ambiguous, and that ambiguity is already resolved by the implementation; if it's a problem, update the BIP text to match the implementation. Changing the implementation risks "soft" confiscating funds (ie, transactions that were relayable become non-standard and can only be mined directly), which doesn't seem at all worth doing.

@roconnor-blockstream

Copy link
Copy Markdown
Contributor Author

I don't think the wording "passed to a sigop" is ambiguous at all, but I'm fine with the BIP text being clarified if someone wants to do that instead.

I don't have a strong opinion on how to resolve the disagreement. I do think that updating the implementation is slightly better, but only slightly.

@billymcbip

Copy link
Copy Markdown
Contributor

Concept NACK 5ea1ea8

This would further increase the complexity of OP_CHECKMULTISIG in interpreter.cpp and it's a net LOC increase.

The unit tests explicitly assert that unused uncompressed keys are policy-valid. Even if our current implementation does not match BIP-143, this change would break an existing expectation.

We should update BIP-143 instead and align it with the implementation.

@sedited

sedited commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

There's not been much activity here the past few months. @roconnor-blockstream given the lack of interest in favor of this change, maybe an amendment to the BIP would be a better use of time?

@ajtowns

ajtowns commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

I think it would fine to close this and continue discussing approaches in #33882?

@maflcko

maflcko commented Mar 5, 2026

Copy link
Copy Markdown
Member

Ok, closing for now. Let's continue discussion in the other thread.

@maflcko maflcko closed this Mar 5, 2026
jeanpablojp added a commit to jeanpablojp/bips that referenced this pull request Dec 3, 2026
In OP_CHECKMULTISIG, Bitcoin Core only checks the public keys the opcode
reaches, and its script tests have vectors where an uncompressed key
that is not reached passes with WITNESS_PUBKEYTYPE. Reviewers of
bitcoin/bitcoin#33759 preferred changing the BIP to match, see also
item 4 of bitcoin/bitcoin#33882.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants