Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions bip-0376.mediawiki
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,30 @@ These are new fields added to the existing PSBT format. Because PSBT is designed

== Reference implementation ==

'''''TODO'''''
A Python reference implementation is provided in [[bip-0376/reference.py|<code>bip-0376/reference.py</code>]].
It uses the vendored <code>bitcoin_test</code> PSBT components and <code>secp256k1lab</code> test-only secp256k1 implementation from BIP 375.

It demonstrates the Signer behavior specified in this BIP:

* Key derivation using ''d = (b<sub>spend</sub> + tweak) mod n''.
* Key negation when ''d·G'' has odd y-coordinate.
* Verification that the resulting x-only public key matches the output key ''P''.
* BIP 340 signing with the derived key.

=== Test vectors ===

'''''TODO'''''
Machine-readable test vectors are provided in [[bip-0376/test-vectors.json|<code>bip-0376/test-vectors.json</code>]].

The vector set includes:

* Valid signing cases with and without key negation.
* Invalid cases for output-key mismatch, zero tweaked key, and out-of-range spend key.

The reference implementation can be run against the vectors with:

<pre>
./bip-0376/reference.py bip-0376/test-vectors.json
</pre>

== Appendix ==

Expand Down
Loading