After creating a 2:3 multisig based address, funding this address and generating the raw (unsigned) transaction to spend from the generated address, the scriptSig of vin is empty. This will lead to incorrect informations being shown about the transaction.
Expected behavior
scriptSig properties asm and hex are being set. Using an older version of bitcoind (bitcoin-0.16.3) this was working correctly.
Actual behavior
scriptSig properties asm and hex are not being set when generating the raw transaction (without signing it).
To reproduce
1.) Generate the multisig address:
self::call('createmultisig', [
2,
[
'02ab224d0d8de7d5ad5568bf4f66b9c29ea7afd0f196176f9b09a311c11da6377e',
'02d8adfda5e3266bc9f237c67135f795e069dabe594a39f2908e666d27c4e000fe',
'02f485412017ef4fba059a514e3d90d95c1b0f3dced6ab158ef697127a8a1cb58e',
],
'legacy',
]);`
"{"result":{"address":"336tZcUKH1EUccEvPdGcUSUJHtNLG373GF","redeemScript":"522102ab224d0d8de7d5ad5568bf4f66b9c29ea7afd0f196176f9b09a311c11da6377e2102d8adfda5e3266bc9f237c67135f795e069dabe594a39f2908e666d27c4e000fe2102f485412017ef4fba059a514e3d90d95c1b0f3dced6ab158ef697127a8a1cb58e53ae"},"error":null,"id":null} "
2.) Fund the address, done by TXID: 53b0a553881e67311d47ca8adc1138edf4309beaef5c8cc9e01a33b9ce334230
3.) Generate a transaction to spend from address 336tZcUKH1EUccEvPdGcUSUJHtNLG373GF:
$raw_transaction = $daemon->call('createrawtransaction', [
[
[
'txid' => '53b0a553881e67311d47ca8adc1138edf4309beaef5c8cc9e01a33b9ce334230',
'vout' => 1,
'sequence' => 4294967293,
]
],
[
"1B4pqxU3EEXQtsc7fdaGhiHM9NN9rChuJS" => "0.00057394",
]
]);
Returns:
{"result":"0200000001304233ceb9331ae0c98c5cefea9b30f4ed3811dc8aca471d31671e8853a5b0530100000000fdffffff0132e00000000000001976a9146e6a71a663b9952ed8af1aa456997cf52f14c20388ac00000000","error":null,"id":null} "
Now when using the CLI do decode the transaction:
./bitcoin-0.19.0.1/bin/bitcoin-cli decoderawtransaction 0200000001304233ceb9331ae0c98c5cefea9b30f4ed3811dc8aca471d31671e8853a5b0530100000000fdffffff0132e00000000000001976a9146e6a71a663b9952ed8af1aa456997cf52f14c20388ac00000000
You'll see the hex & asm fields of vin are empty:
...
"vin": [
{
"txid": "53b0a553881e67311d47ca8adc1138edf4309beaef5c8cc9e01a33b9ce334230",
"vout": 1,
"scriptSig": {
"asm": "",
"hex": ""
},
Is it necesarry to pass the reedemScriptto the createrawtransaction command? All I found using the doc was the option to pass
{ (json object) "data": "hex", (string, required) A key-value pair. The key must be "data", the value is hex-encoded data },
to the createrawtransaction function, is it correct to pass the reedemScript, if yes, how to do so?
Running bitcoin-0.16.3 on another machine, the problem isn't occurring.
System information
<!-- bitcoin-0.19.0.1 already builded. -->
<!-- What type of machine are you observing the error on (OS/CPU and disk type)? -->
x86_64-linux