Issue Details
- Number
- 27391
- Title
- rpc: show P2(W)SH redeemScript in getrawtransaction (and friends)
- Description
- ### 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:
```
# Raw OP_CHECKMULTISIG: 20 x 4 sigops each
bitcoin-cli getblock 00000000000000000002ec935e245f8ae70fc68cc828f05bf4cfa002668599e4 2 | jq -r '.tx[].vout[].scriptPubKey.asm' | grep OP_CHECKMULTISIG | wc -l
# Raw OP_CHECKSIG(VERIFY): 4 sigops each
bitcoin-cli getblock 00000000000000000002ec935e245f8ae70fc68cc828f05bf4cfa002668599e4 2 | jq -r '.tx[].vout[].scriptPubKey.asm' | grep OP_CHECKSIG | wc -l
```
Ideally something like this should work:
```
# TODO: OP_CHECK(MULTI)SIG in redeemScript:
… jq -r '.tx[].vin[].redeemScript.asm …
… 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_
- URL
-
https://github.com/bitcoin/bitcoin/issue/27391
- Closed by
-
Back to List