Skip to content

BIP-0322: remove address optionality for PoF#2188

Merged
jonatack merged 2 commits into
bitcoin:masterfrom
guggero:bip322-fix
Jun 4, 2026
Merged

BIP-0322: remove address optionality for PoF#2188
jonatack merged 2 commits into
bitcoin:masterfrom
guggero:bip322-fix

Conversation

@guggero
Copy link
Copy Markdown
Contributor

@guggero guggero commented Jun 2, 2026

This is cleaning up an artifact that was left over from #1352.
The alternative to removing the optionality of the address would be to assume OP_TRUE in case of an empty address.
But that sounds like it could open up any number of potential vulnerabilities.
And a user still has the ability to use an OP_TRUE script in a p2wsh or p2tr address.

@guggero
Copy link
Copy Markdown
Contributor Author

guggero commented Jun 2, 2026

Also pushed a commit that clarifies that even for Proof of Funds signatures the
sequence of the first input is considered as "age S".
The reasoning behind this is that only the first input is a synthetic
one that doesn't reference a real transaction to which the height could
be compared against. Even though the Proof of Funds inputs could have
higher sequence values, those heights might have already been long
reached and would make the sequence values irrelevant compared to the potential
restrictions in the challenge script.

Relevance: btcsuite/btcd#2521 (comment)

@jonatack jonatack added the BIP Update by Owner PR by Author or Deputy to modify their own BIP label Jun 2, 2026
Copy link
Copy Markdown
Member

@jonatack jonatack left a comment

Choose a reason for hiding this comment

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

Do you think a changelog entry is needed for this change?

(Edit, for informational purposes here is the relevant section of BIP 3:)

A Complete BIP can only move to Deployed or Closed. Any necessary changes to the specification should be minimal and interfere as little as possible with ongoing adoption. If a Complete BIP is found to need substantial functional changes, it may be preferable to move it to Closed[^new-BIP], and to start a new BIP with the changes instead. Otherwise, it could cause confusion as to what being compliant with the BIP means.

Comment thread bip-0322.mediawiki
@murchandamus murchandamus added the PR Author action required Needs updates, has unaddressed review comments, or is otherwise waiting for PR author label Jun 2, 2026
@guggero
Copy link
Copy Markdown
Contributor Author

guggero commented Jun 3, 2026

@scgbckbone pinging you here since you have a PoF implementation. How did you interpret the address optionality for PoF in the ColdCard implementation? Do you allow the address (message_challenge) to be empty?

@scgbckbone
Copy link
Copy Markdown
Contributor

@scgbckbone pinging you here since you have a PoF implementation. How did you interpret the address optionality for PoF in the ColdCard implementation? Do you allow the address (message_challenge) to be empty?

not allowed in released version of Coldcard firmware. Also not planning to allow it - do not see the use of it. Am I missing something ? what would be the point of allowing empty spk ?

@guggero
Copy link
Copy Markdown
Contributor Author

guggero commented Jun 4, 2026

not allowed in released version of Coldcard firmware. Also not planning to allow it - do not see the use of it. Am I missing something ? what would be the point of allowing empty spk ?

Okay, good to know, thanks. I don't see a use case either, that's why I'm removing that (probably left-over from an earlier change) fragment in 91c6685.
I just wanted to make sure this doesn't directly interfere with your current or future implementation.

guggero added 2 commits June 4, 2026 10:54
This is cleaning up an artifact that was left over from bitcoin#1352.
The alternative to removing the optionality of the address
would be to assume OP_TRUE in case of an empty address.
But that sounds like it could open up any number of potential
vulnerabilities.
And a user still has the ability to use an OP_TRUE script
in a p2wsh or p2tr address.
This commit clarifies that even for Proof of Funds signatures the
sequence of the first input is considered as "age S".
The reasoning behind this is that only the first input is a synthetic
one that doesn't reference a real transaction to which the height could
be compared against. Even though the Proof of Funds inputs could have
higher sequence values, those heights might have already been long
reached and would make the sequence values irrelevant compared to the potential
restrictions in the challenge script.
@guggero
Copy link
Copy Markdown
Contributor Author

guggero commented Jun 4, 2026

Do you think a changelog entry is needed for this change?

(Edit, for informational purposes here is the relevant section of BIP 3:)

A Complete BIP can only move to Deployed or Closed. Any necessary changes to the specification should be minimal and interfere as little as possible with ongoing adoption. If a Complete BIP is found to need substantial functional changes, it may be preferable to move it to Closed[^new-BIP], and to start a new BIP with the changes instead. Otherwise, it could cause confusion as to what being compliant with the BIP means.

You're right, the removal of the address optionality is not a minor change and might affect existing implementations. I added a changelog entry to make that clear.
And I also did a bit of research into existing implementations, who would be affected:

Therefore I hope that the actual impact of this change is minimal at this point in time.

@jonatack jonatack removed the PR Author action required Needs updates, has unaddressed review comments, or is otherwise waiting for PR author label Jun 4, 2026
@jonatack jonatack merged commit c81d423 into bitcoin:master Jun 4, 2026
4 checks passed
@jonatack
Copy link
Copy Markdown
Member

jonatack commented Jun 4, 2026

@guggero LGTM, with one question on the changelog entry.

Given this change could theoretically break compatibility for any implementation, not known at this time, that allowed address-less PoFs, per BIP 3 it would be a major version bump? Perhaps there is enough confidence per #2188 (comment) that currently no such implementations are in use. OTOH version numbers are cheap.

The MAJOR version is incremented if changes to the BIP’s Specification are introduced that are incompatible with prior versions (which should be rare after a BIP is Complete, and only happen in well-grounded exceptional cases to a BIP that is Deployed). The MINOR version is incremented whenever the specification of the BIP is changed or extended in a backward-compatible way. The PATCH version is incremented for other changes to the BIP that are noteworthy (bug fixes, test vectors, important clarifications, etc.)

@murchandamus
Copy link
Copy Markdown
Member

@guggero LGTM, with one question on the changelog entry.

Given this change could theoretically break compatibility for any implementation, not known at this time, that allowed address-less PoFs, per BIP 3 it would be a major version bump?

I agree that this should have been more than a PATCH bump, but I don’t understand why you leave feedback that should be addressed within minutes of merging a change. It would have been better to just leave the feedback and merge it after it was addressed, there wasn’t any time pressure here.

@guggero
Copy link
Copy Markdown
Contributor Author

guggero commented Jun 4, 2026

@jonatack okay, addressed in #2190.

guggero added a commit to guggero/bips that referenced this pull request Jun 5, 2026
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.

4 participants