Commit Graph
17 Commits
Author SHA1 Message Date
macgyver13 434a4d2659 BIP-375: update labeled test vectors
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
2026-11-04 18:14:49 -05:00
Jon Atack 4f979daf78 Merge pull request #2286 from wangjingshuiku/master
BIP375: validate PSBT_OUT_SP_V0_LABEL length
2026-09-27 10:55:17 -07:00
Bruce0X 7999f8aa1c bip375: sync vendored DLEQ code with BIP-374
bip-0375/deps/dleq.py is adapted from the BIP-374 reference code but
predates the change that treats the challenge e as a scalar (#2262).
Reduce the challenge hash mod n and reject proofs with e >= n, so the
copy used by the BIP-375 validator matches the current BIP-374
reference.
2026-09-25 15:55:49 +04:00
wangjingshuiku 7ccde10a3c BIP375: validate PSBT_OUT_SP_V0_LABEL length 2026-09-12 17:00:00 +08:00
questfever e726d13ade BIP375: correctly detect SegWit v2+ witness programs 2026-08-13 17:29:30 +08:00
macgyver13 b217897a62 BIP-375: fix label byte order used by labelhash
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
2026-04-09 18:07:10 -04:00
macgyver13 897455dab7 BIP-375: skip ineligible inputs when combining ecdh shares
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
2026-04-05 20:52:23 -04:00
macgyver13 7b4f1d6b4e BIP-375: address review feedback
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)
2026-04-05 19:55:53 -04:00
macgyver13 cf7a16a5f9 BIP-375: update documentation
Update Test Vectors section
Add README.md to explain validation tooling and dependencies
2026-04-04 09:17:46 -04:00
macgyver13 fb105b7e51 BIP-375: add output scripts validation
Add support for computing bip352 output scripts
Extract ECDH shares and public key from PSBT and aggregate both if necessary
Refactor validate_ecdh_coverage to use collect_input_ecdh_and_pubkey
2026-04-04 09:17:46 -04:00
macgyver13 ab30224051 BIP-375: add input eligibility validation
Verify segwit version >1 not used if silent payment outputs present (bip352)
Verify SIGHASH_ALL requirement
2026-04-04 09:17:46 -04:00
macgyver13 6a91f88030 BIP-375: add ecdh coverage validation
Add deps/dleq.py (Adapted from bip-0374/reference.py)
Extract pubkey from PSBT inputs 
- PSBT_IN_BIP32_DERIVATION
- PSBT_IN_WITNESS_UTXO for P2TR
Add script type helpers
- bip352 input eligibility helpers
2026-04-04 09:17:46 -04:00
macgyver13 66053ae879 BIP-375: add test_runner and validate PSBT structure
Implement psbt structure checks
Add test_runner.py for processing test vectors
2026-04-04 09:17:46 -04:00
macgyver13 fc9918d8c0 BIP-375: add BIP375PSBT extension classes
BIP375PSBT (a PSBT subclass that deserializes into BIP375PSBTMap instances)
BIP375PSBTMap (a PSBTMap subclass with BIP-375 field access helpers)
2026-04-04 09:17:46 -04:00
macgyver13 8b46bd63b5 BIP-375: add test vector file 2026-04-04 09:17:46 -04:00
macgyver13 e70510193f Merge commit '96000a36c22f6528e834c54f0d115db675198e57' as 'bip-0375/deps/secp256k1lab' 2026-03-23 17:42:04 -04:00
macgyver13 a8aa5ed548 BIP-375: Add bitcoin test framework as dependency - deps/bitcoin_test 2026-03-23 17:42:04 -04:00