summaryrefslogtreecommitdiff
path: root/bip-0341.mediawiki
diff options
context:
space:
mode:
authorPieter Wuille <pieter@wuille.net>2021-10-27 17:31:17 -0400
committerPieter Wuille <pieter@wuille.net>2021-11-12 12:08:19 -0500
commite35a46ecf3031c21dc7f7fdb694986789a3a8144 (patch)
tree7dec74c800b9d04f21499bbfc5da28b1911781d8 /bip-0341.mediawiki
parentb15514325e25d30dcf07d4e7f87ef72fea408437 (diff)
downloadbips-e35a46ecf3031c21dc7f7fdb694986789a3a8144.tar.xz
BIP341 test vectors
Diffstat (limited to 'bip-0341.mediawiki')
-rw-r--r--bip-0341.mediawiki8
1 files changed, 7 insertions, 1 deletions
diff --git a/bip-0341.mediawiki b/bip-0341.mediawiki
index 13249b5..bee3239 100644
--- a/bip-0341.mediawiki
+++ b/bip-0341.mediawiki
@@ -286,7 +286,13 @@ The reason for this is to increase leaf entropy and prevent an observer from lea
== Test vectors ==
-The test vectors used in the [https://github.com/bitcoin/bitcoin/blob/3820090bd619ac85ab35eff376c03136fe4a9f04/src/test/script_tests.cpp#L1718 Bitcoin Core unit test framework] can be found [https://github.com/bitcoin-core/qa-assets/blob/main/unit_test_data/script_assets_test.json?raw=true here].
+Test vectors for wallet operation (scriptPubKey computation, key path spending, control block construction) can be found [[bip-0341/wallet-test-vectors.json|here]].
+It consists of two sets of vectors.
+* The first "scriptPubKey" tests concern computing the scriptPubKey and (mainnet) BIP350 address given an internal public key, and a script tree. The script tree is encoded as <code>null</code> to represent no scripts, a JSON object to represent a leaf node, or a 2-element array to represent an inner node. The control blocks needed for script path spending are also provided for each of the script leaves.
+* The second "keyPathSpending" tests consists of a list of test cases, each of which provides an unsigned transaction and the UTXOs it spends. For each of its BIP341 inputs, the internal private key and the Merkle root it was derived from is given, as well as the expected witness to spend it. All signatures are created with an all-zero (0x0000...0000) BIP340 auxiliary randomness array.
+* In all cases, hexadecimal values represent byte arrays, not numbers. In particular, that means that provided hash values have the hex digits corresponding to the first bytes first. This differs from the convention used for txids and block hashes, where the hex strings represent numbers, resulting in a reversed order.
+
+Validation test vectors used in the [https://github.com/bitcoin/bitcoin/blob/3820090bd619ac85ab35eff376c03136fe4a9f04/src/test/script_tests.cpp#L1718 Bitcoin Core unit test framework] can be found [https://github.com/bitcoin-core/qa-assets/blob/main/unit_test_data/script_assets_test.json?raw=true here].
== Rationale ==