Please describe the feature you’d like to see added.
I’d like to be able to get the (decompiled) P2SH redeemScript
and P2WSH witnessScript
when calling getrawtransaction
and getblock … 2
.
Is your feature related to a problem, if so please describe it.
I found myself having a hard time counting sigops in the recently invalid block. For scriptPubKey it’s easy:
0# Raw OP_CHECKMULTISIG: 20 x 4 sigops each
1bitcoin-cli getblock 00000000000000000002ec935e245f8ae70fc68cc828f05bf4cfa002668599e4 2 | jq -r '.tx[].vout[].scriptPubKey.asm' | grep OP_CHECKMULTISIG | wc -l
2# Raw OP_CHECKSIG(VERIFY): 4 sigops each
3bitcoin-cli getblock 00000000000000000002ec935e245f8ae70fc68cc828f05bf4cfa002668599e4 2 | jq -r '.tx[].vout[].scriptPubKey.asm' | grep OP_CHECKSIG | wc -l
Ideally something like this should work:
0# TODO: OP_CHECK(MULTI)SIG in redeemScript:
1… jq -r '.tx[].vin[].redeemScript.asm …
2… jq -r '.tx[].vin[].witnesScript.asm …
https://twitter.com/provoost/status/1642165984629780481
Describe the solution you’d like
An attempt was made in #8849.
Describe any alternatives you’ve considered
Inferred miniscript would catch many common P2WSH scripts, but not regular P2SH.
Please leave any additional context
No response