-
Notifications
You must be signed in to change notification settings - Fork 7
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
bitcoin-util evalscript subcommand #58
bitcoin-util evalscript subcommand #58
Conversation
9441cd1
to
c171271
Compare
I think the signature checking is usable now: $ ./bitcoin-util --sigversion=tapscript \
--tx=02000000000101d1b5f18e8dcbaaa382b398a578f968e69fd72176768ccd4649a06491beb713310000000000e0070000012c4c000000000000225120fb4ea97f00be442dac392022a0c6b813f01881aa2fc006aaa225495365af68f30340ec3517b63e035c22f3659bfd30b9f440049b697a8d1cb8ef721658d683fa66c6c3f598d25682381c43fba7c94b5f994537041960d0c0e8c596fdcc1170b241c826201bd43c4c240e0244871afe0650bdbedb13780a9d0644c4aa2398f46f20f46130ad02e007b261c050929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0614534a82971ff9ddda889c53b1e2ec43baa9db27da7d6c49b4121c18756c28dcc2dea9ee4098432b2c61221c4bfbc793f5ecdd2d42d3544a0146ae693c5493d00000000 \
--input=0 \
--spent_output=204e000000000000225120bc2d293f6482e242e12330379bb255f9f2f853a25ec19ed40f54a149c3af6315 \
--ipk=50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0 \
--script_flags=STANDARD \
evalscript \
'0x201bd43c4c240e0244871afe0650bdbedb13780a9d0644c4aa2398f46f20f46130 OP_CHECKSIGVERIFY 2016 OP_CHECKSEQUENCEVERIFY' \
'ec3517b63e035c22f3659bfd30b9f440049b697a8d1cb8ef721658d683fa66c6c3f598d25682381c43fba7c94b5f994537041960d0c0e8c596fdcc1170b241c8' {
"script": {
"asm": "1bd43c4c240e0244871afe0650bdbedb13780a9d0644c4aa2398f46f20f46130 OP_CHECKSIGVERIFY 2016 OP_CHECKSEQUENCEVERIFY",
"hex": "201bd43c4c240e0244871afe0650bdbedb13780a9d0644c4aa2398f46f20f46130ad02e007b2",
"type": "nonstandard"
},
"sigversion": "tapscript",
"script_flags": [
"ANYPREVOUT",
"CHECKLOCKTIMEVERIFY",
"CHECKSEQUENCEVERIFY",
"CLEANSTACK",
"CONST_SCRIPTCODE",
"DEFAULT_CHECK_TEMPLATE_VERIFY_HASH",
"DERSIG",
"DISCOURAGE_OP_SUCCESS",
"DISCOURAGE_UPGRADABLE_CHECK_TEMPLATE_VERIFY_HASH",
"DISCOURAGE_UPGRADABLE_NOPS",
"DISCOURAGE_UPGRADABLE_PUBKEYTYPE",
"DISCOURAGE_UPGRADABLE_TAPROOT_VERSION",
"DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM",
"LOW_S",
"MINIMALDATA",
"MINIMALIF",
"NULLDUMMY",
"NULLFAIL",
"OP_CAT",
"P2SH",
"STRICTENC",
"TAPROOT",
"WITNESS",
"WITNESS_PUBKEYTYPE"
],
"stack-after": [
"e007"
],
"sigop-count": 0,
"success": true
} (Taken from tx 928f9e4c445d2f67d44a29600bf48616aa16797e9d0b8a9ef81532358a6211e7 on signet) |
CHECKSIG doesn't work if you don't specify the various options, and CSV/CLTV don't work unless you specify a tx that actually satisfies the constraints. Might be good to grab the EDIT: now done |
d83bad9
to
8c1bda8
Compare
Introduces an
evalscript
subcommand for bitcoin-util that evaluates a script directly.Relies on upstream PRs bitcoin#28802 and bitcoin#28806.
Example:
Provides
--sigversion
(base
,witness_v0
ortapscript
) to select different script versions, and--script_flags
to enable the various script flags, eg: