-
Notifications
You must be signed in to change notification settings - Fork 38.7k
test: refactor: add script_util helper for creating bare multisig scripts
#23305
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
test: refactor: add script_util helper for creating bare multisig scripts
#23305
Conversation
|
Concept ACK The canonical bare multisig construction in |
31ca61b to
61cf9ac
Compare
|
Rebased on master and changed threshold parameter name from "m" to "k", to match the optech style guide (as suggested by MarcoFalke). |
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsNo conflicts as of last run. |
61cf9ac to
4718897
Compare
|
Rebased on master. |
shaavan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK 4718897
This PR declares a new helper function keys_to_multisig_script in the file script_util.py, which serves two purposes:
- Helps simplify the code; each time, a bare multisig script needs to be created.
- Reduce the number of times different files have to import
CScriptandOP_CHECKMULTISIGas dependencies.
rajarshimaitra
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK 4718897
Verified that no other bare multisig cases exists.
…ating bare multisig scripts 4718897 test: add script_util helper for creating bare multisig scripts (Sebastian Falbesoner) Pull request description: This PR is a follow-up to bitcoin#22363 and bitcoin#23118 and introduces a helper `keys_to_multisig_script` for creating bare multisig outputs in the form of ``` OP_K PubKey1 PubKey2 ... PubKeyN OP_N OP_CHECKMULTISIG ``` The function takes a list of pubkeys (both hex- and byte-strings are accepted due to the `script_util.check_key` helper being used internally) and optionally a threshold _k_. If no threshold is passed, a n-of-n multisig output is created, with _n_ being the number of passed pubkeys. ACKs for top commit: shaavan: utACK 4718897 rajarshimaitra: tACK bitcoin@4718897 Tree-SHA512: b452d8a75b0d17316b66ac4ed4c6893fe59c7c417719931d4cd3955161f59afca43503cd09b83a35b5a252a122eb3f0fbb9da9f0e7c944cf8da572a02219ed9d
This PR is a follow-up to #22363 and #23118 and introduces a helper
keys_to_multisig_scriptfor creating bare multisig outputs in the form ofThe function takes a list of pubkeys (both hex- and byte-strings are accepted due to the
script_util.check_keyhelper being used internally) and optionally a threshold k. If no threshold is passed, a n-of-n multisig output is created, with n being the number of passed pubkeys.