You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: bip-0375.mediawiki
+150-1Lines changed: 150 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -249,7 +249,156 @@ Silent payment capable PSBTs are backwards compatible with PSBTv2 once all outpu
249
249
250
250
==Test Vectors==
251
251
252
-
Todo
252
+
A [[bip-0375/bip375_test_vectors.json|collection of test vectors in JSON format]] is provided. Each test vector contains a base64-encoded PSBT string, which alone can be used to verify sending Silent Payments with PSBTs.
253
+
Validation is performed in 4 sequential checks. This [[bip-0375/validator/validate_psbt.py|Python implementation]] demonstrates the validation logic for each:
254
+
255
+
# '''PSBT Structure''' - Verify BIP375 field requirements
256
+
# '''ECDH Coverage''' - Verify ECDH share presence and correctness using BIP374 DLEQ
257
+
# '''Input Eligibility''' - Verify input constraints when silent payment outputs are present
-**`validator/psbt_bip375.py`** - BIP-375 specific PSBT/PSBTMap extensions
9
+
-**`validator/validate_psbt.py`** - Main BIP-375 validation functions
10
+
-**`test_runner.py`** - Test infrastructure (executable)
11
+
12
+
## Dependencies
13
+
-**`deps/bitcoin_test/psbt.py`** - Bitcoin test framework PSBT module - [PR #21283](https://github.com/bitcoin/bitcoin/pull/21283)
14
+
-**`deps/bitcoin_test/messages.py`** - Bitcoin test framework primitives and message structures
15
+
-**`deps/dleq.py`** - Reference DLEQ implementation from BIP-374
16
+
-**`deps/secp256k1lab/`** - vendored copy of [secp256k1lab](https://github.com/secp256k1lab/secp256k1lab/commit/44dc4bd893b8f03e621585e3bf255253e0e0fbfb) library at version 1.0.0
17
+
18
+
## Testing
19
+
20
+
### Run Tests
21
+
22
+
```bash
23
+
python test_runner.py # Run all tests
24
+
python test_runner.py -v # Verbose mode with detailed validation status
25
+
python test_runner.py -vv # More verbose with validation check failure reason
26
+
27
+
python test_runner.py -f vectors.json # Use custom test vector file
28
+
```
29
+
30
+
### Generating Test Vectors
31
+
32
+
Test vectors were generated using [test_generator.py](https://github.com/macgyver13/bip375-test-generator/)
0 commit comments