BIP-375: correct labeled test vectors to include labeled-spend key in PSBT_OUT_SP_V0_INFO - #2207
BIP-375: correct labeled test vectors to include labeled-spend key in PSBT_OUT_SP_V0_INFO#2207macgyver13 wants to merge 2 commits into
Conversation
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).
|
cc BIP Owners for review: @andrewtoth, @achow101, @josibake |
|
Implementer's note. btclib has a BIP375 implementation and currently Measured, in both directions, with
No invalid vector changes verdict under either rule. The two invalid Two remarks, one per half of the PR. The On the ordering half, a question about the rule rather than about which
So index order looks like the cheaper rule, and it is what all three We have no stake beyond interoperability and will follow whichever way Unrelated and not touched here, noted while checking the above: L149 Edited: the last paragraph originally called this an inconsistency about |
|
@fametrano Thank you for the report. It is a little hard to understand, can you summarize more concisely in your own words, please? |
|
@jonatack in short: I support the labeled-spend-key half of this PR, it looks right regardless of the ordering question. The sort half is the alternative to #2256, which changes the text to the index order the current validator and vectors already follow; either direction removes the contradiction, and the owners' preference decides which of the two lands. The measurement in both directions is reproducible from the diff posted on #2256. |
|
Partial nACK, to make my note above explicit: nACK the ordering half, ACK the ACK the labeled-spend-key fix. Carrying the labeled spend key is correct and is needed whichever ordering rule wins; this half should land. nACK the switch to lexicographic ordering. As measured above: the k assignment is invisible to a BIP352 receiver and serves only Signer/Extractor determinism, so any deterministic rule is equally correct and the choice is one of cost. Lexicographic's one advantage — invariance under output reordering — is unavailable here: L185 makes a Signer clear Outputs Modifiable when it sets a script, and Could this be two PRs? The two fixes are independent and only the ordering one is contested. Splitting them lets the |
Includes two changes to align the labeled test vectors and validation reference with BIP-375:
Changed vectors:
Test Runner Output