2:3 multisig transaction scriptSig attributes empty / not occuring on bitcoin-0.16.3 #18620

issue ghost opened this issue on April 13, 2020
  1. ghost commented at 12:39 PM on April 13, 2020: none

    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

  2. unknown added the label Bug on Apr 13, 2020
  3. kouloumos commented at 9:44 PM on August 9, 2022: contributor

    *rawtransaction RPCs are not wallet depended, createrawtransaction does not know the script, it is revealed during signing. That's why scriptSig is available after signing but not before.

    It seems that there is not a way (and reason?) to pass the reedemScript before signing.

    Still not sure how this was not occurring on the other machine.

  4. MarcoFalke commented at 8:39 AM on August 10, 2022: member

    Closing for now until there is more info

  5. MarcoFalke closed this on Aug 10, 2022

  6. bitcoin locked this on Aug 10, 2023
Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 15:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me