Taproot wallet test vectors (generation+tests)#23394
Closed
sipa wants to merge 7 commits intobitcoin:masterfrom
Closed
Taproot wallet test vectors (generation+tests)#23394sipa wants to merge 7 commits intobitcoin:masterfrom
sipa wants to merge 7 commits intobitcoin:masterfrom
Conversation
514db62 to
7b225a5
Compare
7b225a5 to
b9de4f1
Compare
Contributor
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsNo conflicts as of last run. |
This was referenced Oct 30, 2021
junderw
reviewed
Nov 2, 2021
Member
Author
|
I'm going to convert this to construct tests in JSON format rather than Mediawiki, and also actually run it in that form directly. |
c7465b9 to
41f002d
Compare
41f002d to
b9770ac
Compare
sanket1729
reviewed
Nov 6, 2021
22d1f3f to
5c4550c
Compare
Member
Author
|
Updated to address bitcoin/bips#1225 (review) |
laanwj
reviewed
Nov 8, 2021
b9de4f1 to
c35c276
Compare
c35c276 to
19dd87c
Compare
Member
Author
|
Rebased. |
libsecp256k1's secp256k1_schnorrsig_sign only follows BIP340 exactly if an aux_rand32 argument is passed. When no randomness is used (as is the case in the current codebase here), there is no impact on security between not providing aux_rand32 at all, or providing an empty one. Yet, for repeatability/testability it is simpler to always use an all-zero one.
This does the following: * Adds a rfc6979 argument to test_framework/key.py's sign_ecdsa to select (deterministic) RFC6979-based nonce generation. * Add a flag in feature_taproot.py's framework called "deterministic". * Make the Schnorr signing in feature_taproot.py randomized by default, reverting to the old deterministic (aux_rnd=0x0000...00) behavior if the deterministic context flag is set. * Make the ECDSA signing in feature_taproot.py use RFC6979-based nonces when the deterministic context flag is set (keeping the old randomized behavior otherwise).
19dd87c to
f1c33ee
Compare
Member
Author
|
Updated to address bitcoin/bips#1225 (comment). |
Member
Author
|
Corresponding BIP change was merged: bitcoin/bips#1225 |
Member
|
Code review ACK f1c33ee |
laanwj
added a commit
to bitcoin-core/gui
that referenced
this pull request
Nov 15, 2021
…tests) f1c33ee tests: implement BIP341 test vectors (Pieter Wuille) ac3037d tests: BIP341 test vector generation (Pieter Wuille) ca83ffc tests: add deterministic signing mode to ECDSA (Pieter Wuille) c98c53f tests: abstract out precomputed BIP341 signature hash elements (Pieter Wuille) a5bde01 tests: give feature_taproot access to sighash preimages (Pieter Wuille) 5140825 tests: add more fields to TaprootInfo (Pieter Wuille) 2478c67 Make signing follow BIP340 exactly w.r.t. aux randomness (Pieter Wuille) Pull request description: This PR adds code to `test/functional/feature_taproot.py` which runs through a (deterministic) scenario covering several aspects of the wallet side of BIP341 (scriptPubKey computation from keys/scripts, control block computation, key path spending), with the ability to output test vectors in mediawiki format based on this scenario. The generated tests are then also included directly in `src/test/script_tests.cpp` and `src/test/script_standard_tests.cpp`. I intend to add these test vectors to BIP341 itself: bitcoin/bips#1225 ACKs for top commit: laanwj: Code review ACK f1c33ee Tree-SHA512: fcf7109539cb214d3190516b205cd32d2b1b452f14aa66f4107acfaa8bfc7d368f626857f1935665a4342eabc0b9ee8aba608a7c0a2494bec0b498e723439c9d
Member
|
Closing: PR was merged, github didn't detect it |
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This PR adds code to
test/functional/feature_taproot.pywhich runs through a (deterministic) scenario covering several aspects of the wallet side of BIP341 (scriptPubKey computation from keys/scripts, control block computation, key path spending), with the ability to output test vectors in mediawiki format based on this scenario. The generated tests are then also included directly insrc/test/script_tests.cppandsrc/test/script_standard_tests.cpp.The test vectors generated here were added to BIP341 in bitcoin/bips#1225