This PR adds code to print a readable asm
version of the redeemScript
of a P2WSH
input in the getrawtransaction
RPC call which is useful to explore that kind of transactions.
Example (on testnet3):
./bitcoin-cli getrawtransaction cd56a4b017bf5aeeb86e1397ac91bb9b4ee091d3be1c89b11b08c196468464bf 1
will output the following (note the new redeemScript
key):
0{
1 "hex": "020000000001014558b8bc7f79efde796a90dca073e0808115365bb792db673cecf323c4eda2b40000000000ffffffff010eb50c00000000002200201d68ed9621fc634989c9988eda4883de4b3c699a154739a28891cb893ee7335c04004730440220120592e838230fb57292258dc98b6603ffd367adefb8f33fdea8b242f92823bc0220441d5fc90f6a3f61678db7bdb8256a61b08468fccad841841ec53791b27b002901483045022100bb3beffa751d485228d84513d84db6d2125af8f51bbaf6dd9a4a6ecbd7f73766022070b3478448192fd0d386a47e9a80b7d66839594526cdf33819c05449714c1242014752210251873cb58e82b8ba295cbaeb31bf5ce546182c6ff094b8c1fd0b33f82299d57721038f199dfacc8d2c83856d4a2ebda9f676962c880f7df3431fa47175940a1e101b52ae00000000",
2 "txid": "cd56a4b017bf5aeeb86e1397ac91bb9b4ee091d3be1c89b11b08c196468464bf",
3 "hash": "28961e39115f22896565e184beeb659ab68f6a8f9f0e4b8ca33699e837c4ca06",
4 "size": 315,
5 "vsize": 150,
6 "version": 2,
7 "locktime": 0,
8 "vin": [
9 {
10 "txid": "b4a2edc423f3ec3c67db92b75b36158180e073a0dc906a79deef797fbcb85845",
11 "vout": 0,
12 "scriptSig": {
13 "asm": "",
14 "hex": ""
15 },
16 "txinwitness": [
17 "",
18 "30440220120592e838230fb57292258dc98b6603ffd367adefb8f33fdea8b242f92823bc0220441d5fc90f6a3f61678db7bdb8256a61b08468fccad841841ec53791b27b002901",
19 "3045022100bb3beffa751d485228d84513d84db6d2125af8f51bbaf6dd9a4a6ecbd7f73766022070b3478448192fd0d386a47e9a80b7d66839594526cdf33819c05449714c124201",
20 "52210251873cb58e82b8ba295cbaeb31bf5ce546182c6ff094b8c1fd0b33f82299d57721038f199dfacc8d2c83856d4a2ebda9f676962c880f7df3431fa47175940a1e101b52ae"
21 ],
22 "redeemScript": {
23 "asm": "2 0251873cb58e82b8ba295cbaeb31bf5ce546182c6ff094b8c1fd0b33f82299d577 038f199dfacc8d2c83856d4a2ebda9f676962c880f7df3431fa47175940a1e101b 2 OP_CHECKMULTISIG",
24 "hex": "52210251873cb58e82b8ba295cbaeb31bf5ce546182c6ff094b8c1fd0b33f82299d57721038f199dfacc8d2c83856d4a2ebda9f676962c880f7df3431fa47175940a1e101b52ae",
25 "reqSigs": 2,
26 "type": "multisig",
27 "addresses": [
28 "mzLfZ7AJNtrcBZqXYXkMXRty6HoQB31Sbo",
29 "n1ANhQLAaEyswK9VWpEqCyTfgFvwtqtAYi"
30 ]
31 },
32 "sequence": 4294967295
33 }
34 ],
35 "vout": [
36 {
37 "value": 0.00832782,
38 "n": 0,
39 "scriptPubKey": {
40 "asm": "0 1d68ed9621fc634989c9988eda4883de4b3c699a154739a28891cb893ee7335c",
41 "hex": "00201d68ed9621fc634989c9988eda4883de4b3c699a154739a28891cb893ee7335c",
42 "type": "witness_v0_scripthash"
43 }
44 }
45 ],
46 "blockhash": "00000000000000fd63636cdfdf9b5469b5cc57b379c40e12ecda58b3dcc7e932",
47 "confirmations": 36672,
48 "time": 1474472930,
49 "blocktime": 1474472930
50}