-
Notifications
You must be signed in to change notification settings - Fork 5.9k
BIP375: Add test vectors + validator #2046
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
murchandamus
merged 16 commits into
bitcoin:master
from
macgyver13:bip375-reference-testvectors-pr
Apr 17, 2026
Merged
Changes from 15 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
a8aa5ed
BIP-375: Add bitcoin test framework as dependency - deps/bitcoin_test
macgyver13 eedb7f9
Squashed 'bip-0375/deps/secp256k1lab/' content from commit 44dc4bd
macgyver13 e705101
Merge commit '96000a36c22f6528e834c54f0d115db675198e57' as 'bip-0375/…
macgyver13 8b46bd6
BIP-375: add test vector file
macgyver13 fc9918d
BIP-375: add BIP375PSBT extension classes
macgyver13 66053ae
BIP-375: add test_runner and validate PSBT structure
macgyver13 6a91f88
BIP-375: add ecdh coverage validation
macgyver13 ab30224
BIP-375: add input eligibility validation
macgyver13 fb105b7
BIP-375: add output scripts validation
macgyver13 cf7a16a
BIP-375: update documentation
macgyver13 7b4f1d6
BIP-375: address review feedback
macgyver13 9536c86
BIP-375: clarify eligible input restriction in Signer text
macgyver13 6295a70
BIP-375: clarify eligible inputs restriction in Computing the Output …
macgyver13 897455d
BIP-375: skip ineligible inputs when combining ecdh shares
macgyver13 b217897
BIP-375: fix label byte order used by labelhash
macgyver13 8c0a9bf
BIP-375: add changelog section
macgyver13 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # BIP-375 Validation Reference | ||
|
|
||
| A reference validation implementation for BIP-375: Sending Silent Payments with PSBTs. | ||
|
|
||
| ## Core Files | ||
| - **`validator/bip352_crypto.py`** - Silent payment output script derivation | ||
| - **`validator/inputs.py`** - PSBT input utility functions | ||
| - **`validator/psbt_bip375.py`** - BIP-375 specific PSBT/PSBTMap extensions | ||
| - **`validator/validate_psbt.py`** - Main BIP-375 validation functions | ||
| - **`test_runner.py`** - Test infrastructure (executable) | ||
|
|
||
| ## Dependencies | ||
| - **`deps/bitcoin_test/psbt.py`** - Bitcoin test framework PSBT module - [PR #21283](https://github.com/bitcoin/bitcoin/pull/21283) | ||
| - **`deps/bitcoin_test/messages.py`** - Bitcoin test framework primitives and message structures | ||
| - **`deps/dleq.py`** - Reference DLEQ implementation from BIP-374 | ||
| - **`deps/secp256k1lab/`** - vendored copy of [secp256k1lab](https://github.com/secp256k1lab/secp256k1lab/commit/44dc4bd893b8f03e621585e3bf255253e0e0fbfb) library at version 1.0.0 | ||
|
|
||
| ## Testing | ||
|
|
||
| ### Run Tests | ||
|
|
||
| ```bash | ||
| python test_runner.py # Run all tests | ||
| python test_runner.py -v # Verbose mode with detailed validation status | ||
| python test_runner.py -vv # More verbose with validation check failure reason | ||
|
|
||
| python test_runner.py -f vectors.json # Use custom test vector file | ||
| ``` | ||
|
|
||
| ### Generating Test Vectors | ||
|
|
||
| Test vectors were generated using [test_generator.py](https://github.com/macgyver13/bip375-test-generator/) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.