The valid vector "input eligibility: bare OP_2 script is not a segwit
v2 witness program" passed only because its "checks" field limited it
to the input eligibility check. Its only input, the bare OP_2, is not
eligible, so its silent payment output script cannot be derived and the
output scripts check fails.
Replace it with a vector that adds an eligible P2WPKH input carrying
the ECDH share and DLEQ proof. The bare OP_2 input keeps only
PSBT_IN_NON_WITNESS_UTXO, which the segwit version check reads, so the
vector still tests that bare OP_2 is not taken for a segwit v2 witness
program, with no "checks" field. The bare OP_2 input is unsigned, so the
vector is In Progress; add its row to the Valid PSBTs table at its
position in the JSON file.
Vector by @macgyver13.
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.3
Test vectors with labels now use big-endian byte order instead of little-endian, matching BIP-352 specification
Summary of test vector changes:
- psbt structure: missing PSBT_OUT_SP_V0_INFO field when PSBT_OUT_SP_V0_LABEL set
- can finalize: one P2WPKH input / two mixed outputs - labeled sp output and BIP 32 change
- can finalize: two sp outputs - output 0 uses label=3 / output 1 uses label=1
add fake ecdh share and dleq proof to P2SH input for valid test: two inputs using per-input ECDH shares - only eligible inputs contribute shares (P2SH excluded)
remove unused return string from is_input_eligible
correctly label witness_utxo vs non_witness_utxo key in supplementary inputs
Summary of test vector changes:
removed test:
- psbt structure: empty PSBT_OUT_SCRIPT field when sending to non-sp output
modified test:
- ecdh coverage: only one ineligible P2SH multisig input when PSBT_OUT_SCRIPT set for sp output
- can finalize: one P2PKH input single-signer
- can finalize: two inputs using per-input ECDH shares - only eligible inputs contribute shares (P2SH excluded)
added test:
- can finalize: two inputs using global ECDH share - only eligible inputs contribute shares (P2SH excluded)