Skip to content

BIP-375: correct labeled test vectors to include labeled-spend key in PSBT_OUT_SP_V0_INFO#2207

Open
macgyver13 wants to merge 2 commits into
bitcoin:masterfrom
macgyver13:bip375-labeled-spend
Open

BIP-375: correct labeled test vectors to include labeled-spend key in PSBT_OUT_SP_V0_INFO#2207
macgyver13 wants to merge 2 commits into
bitcoin:masterfrom
macgyver13:bip375-labeled-spend

Conversation

@macgyver13

Copy link
Copy Markdown
Contributor

Includes two changes to align the labeled test vectors and validation reference with BIP-375:

  • Sort silent payment codes lexicographically then by output index before assigning k values.
  • PSBT_OUT_SP_V0_INFO should carry the labeled-spend public key, not the base-spend public key.

Changed vectors:

  • can finalize: one P2WPKH input / two mixed outputs - labeled sp output and BIP 32 change
  • can finalize: one input / two sp outputs - output 0 has no label / output 1 uses label=0 convention for sp change
  • can finalize: three sp outputs (same scan key) - output 0 uses label=1, outputs 1 and 2 uses label=2 (same spend key)

Test Runner Output

Summary: 41 passed, 0 failed

Now PSBT_OUT_SP_V0_INFO provides labeled-spend public key not the base-spend
public key.

Modify test vector with labeled-spend key to the same recipient from:
two sp outputs - output 0 uses label=3 / output 1 uses label=1
to:
three sp outputs (same scan key) - output 0 uses label=1, outputs 1 and 2 uses label=2 (same spend key)
This vector excercises the BIP375 sorting outputs with same scan key properly.

The next commit will fix the validation logic and address this failing test.

bump ChangeLog to 0.1.2
Fix output script validation for silent payment output ordering when multiple 
outputs share the same scan key (labeled addresses of one recipient).
@macgyver13 macgyver13 marked this pull request as ready for review July 7, 2026 18:09
@murchandamus

Copy link
Copy Markdown
Member

cc BIP Owners for review: @andrewtoth, @achow101, @josibake

@murchandamus murchandamus added Proposed BIP modification PR by non-owner to update BIP content Pending acceptance This BIP modification requires sign-off by the champion of the BIP being modified labels Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Pending acceptance This BIP modification requires sign-off by the champion of the BIP being modified Proposed BIP modification PR by non-owner to update BIP content

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants