Skip to content

BIP375: fixes to Updater role#2120

Closed
nymius wants to merge 3 commits intobitcoin:masterfrom
nymius:changes-to-bip375
Closed

BIP375: fixes to Updater role#2120
nymius wants to merge 3 commits intobitcoin:masterfrom
nymius:changes-to-bip375

Conversation

@nymius
Copy link
Contributor

@nymius nymius commented Mar 12, 2026

Description

While reviewing test vectors for BIP 375, and by looking closer at the spec, I noticed the following:

  • The updater role mentions the addition of PSBT_IN_BIP32_DERIVATION data for p2wpkh, p2sh-p2wpkh and p2pkh, all members of the Inputs for Shared Secret Derivation from BIP 352, but doesn't mention the addition of PSBT_IN_TAP_BIP32_DERIVATION data for p2tr inputs with key path spend path enabled, which are also part of the Inputs for Shared Secret Derivation from BIP 352 list.
  • The argued reason for this is confusing: so the public key is available for creating the ecdh_shared_secret when the private key is not known. This is not making clear that the ECDH shares, on the sending side, can only be produced by the sender private keys.

There is a third point, that was raised before in the BIP 376 specification:

  • It's not clear from the specification which format should the Updater use to not reveal the derivation path and fingerprint on these fields.

To address this:

  • I rephrased the rationale for BIP32_DERIVATION addition in f208b9d
  • I added the mention of PSBT_IN_TAP_BIP32_DERIVATION field in 7d7e034.
  • I specified the same format than BIP 376 to not reveal derivation data in 6838026

cc: @andrewtoth

nymius added 3 commits March 12, 2026 12:17
On the sender side, the public key information provided by the Updater
is used by the Signer in the silent payment output derivation phase to
obtain the private keys required to produce the ecdh shares.
The sender cannot produce the shares from its own public keys, but its
private keys.
This was implied by the former phrase and this change removes the
ambiguity.
P2TR outputs with enabled key path spend are also required to derive
ECDH shares. The Updater role wasn't mentioning this but all the others
Inputs Available for Shared Secret Derivation (P2WPKH, P2PKH,
P2SH-P2WPKH) as per BIP 352.
P2TR is also part of these and should be mentioned too.
@jonatack jonatack added Proposed BIP modification Pending acceptance This BIP modification requires sign-off by the champion of the BIP being modified labels Mar 12, 2026
@andrewtoth
Copy link
Contributor

andrewtoth commented Mar 12, 2026

The argued reason for this is confusing: so the public key is available for creating the ecdh_shared_secret when the private key is not known. This is not making clear that the ECDH shares, on the sending side, can only be produced by the sender private keys.

The reasoning here is for verifying the ECDH shares with the DLEQ proofs that are generated by a signer without the sender private keys. Other entities can handle the PSBT, and in order to verify they would need the public key of the input A.

Without the PSBT_IN_BIP32_DERIVATION, the proof cannot be verified for p2wpkh, p2sh-p2wpkh and p2pkh. However, it can be verified for p2tr because the public key is known. That is the reasoning for the omission. I suppose the explanation for this can be made more clear in the BIP.

@nymius
Copy link
Contributor Author

nymius commented Mar 13, 2026

The reasoning here is for verifying the ECDH shares with the DLEQ proofs that are generated by a signer without the sender private keys. Other entities can handle the PSBT, and in order to verify they would need the public key of the input A.

I see. This is a completely different perspective than the one I was using.
The omission of the case I'm addressing in this PR is because that's already understood from the BIP 174 Updater spec or is there any other reason?

Without the PSBT_IN_BIP32_DERIVATION, the proof cannot be verified for p2wpkh, p2sh-p2wpkh and p2pkh. However, it can be verified for p2tr because the public key is known. That is the reasoning for the omission. I suppose the explanation for this can be made more clear in the BIP.

...and the public key is known because it is in the PSBT_IN_WITNESS_UTXO, right?

@andrewtoth-exo
Copy link

The omission of the case I'm addressing in this PR is because that's already understood from the BIP 174 Updater spec or is there any other reason?

The derivation data from the BIP174 Updater spec is implied to be for the signer to find the correct keys and to detect change. Now it is needed by both signer and extractor for these specific output scripts for verifying DLEQs.

the public key is known because it is in the PSBT_IN_WITNESS_UTXO

Correct.

@nymius
Copy link
Contributor Author

nymius commented Mar 13, 2026

@andrewtoth Is this a case of impersonation?

Anyways, I think we can close this and focus the discussion on how to make this clearer.

@andrewtoth
Copy link
Contributor

I control @andrewtoth-exo as well and forgot to switch before commenting. Apologies for the confusion.

@nymius
Copy link
Contributor Author

nymius commented Mar 13, 2026

Closing because of misunderstood rationale: the original changes weren't intended to produce signatures but to verify DLEQ proofs.

@nymius nymius closed this Mar 13, 2026
@murchandamus murchandamus removed the Pending acceptance This BIP modification requires sign-off by the champion of the BIP being modified label Mar 13, 2026
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