0

Seems like there was a change in how multisig transactions are being created. Running a node using bitcoind v0.16.3 and another one using latest bitcoind (v.0.19.0.1).

The multisig transaction created on the old node can be decoded by coinb.in correctly (it's displayed as a multisig 2:3 transaction). Using the newest bitcoind to create transaction coinb.in isn't able to display it correctly.

Someone involved into this / is there a way to use bitcoind latest version to create a multisig transaction which can be decoded on coinb.in (maybe using parameters when signing)?

Example using bitcoind latest version (v.0.19.0.1).

./bitcoin-cli createmultisig 2 "[\"02ab224d0d8de7d5ad5568bf4f66b9c29ea7afd0f196176f9b09a311c11da6377e\",\"037b3ccfb03f8dc58598619b2f3a91e33012444469fc69b4459760d04c20c4d69c\",\"034254badc6cd5c4fa4e0ca10fb88d289bd7260331c5355ec2361312eafb26eb67\"]"
{
  "address": "3Cvczsgf3JTCHSjPgRACCia5gtyQKJWng8",
  "redeemScript": "522102ab224d0d8de7d5ad5568bf4f66b9c29ea7afd0f196176f9b09a311c11da6377e21037b3ccfb03f8dc58598619b2f3a91e33012444469fc69b4459760d04c20c4d69c21034254badc6cd5c4fa4e0ca10fb88d289bd7260331c5355ec2361312eafb26eb6753ae"
}

Now found the address using TX 63c8c68a3cbf693a2601854496ffd687334c205bcc0e52811ef9c552d0641c01

Important part using getrawtransaction:

{
  "value": 0.00053938,
  "n": 1,
  "scriptPubKey": {
    "asm": "OP_HASH160 7b3c11ea9596776b98f1d7e68ffcf891e860216f OP_EQUAL",
    "hex": "a9147b3c11ea9596776b98f1d7e68ffcf891e860216f87",
    "reqSigs": 1,
    "type": "scripthash",
    "addresses": [
      "3Cvczsgf3JTCHSjPgRACCia5gtyQKJWng8"
    ]
  }

Create a transaction using the information

./bitcoin-cli createrawtransaction "[{\"txid\":\"63c8c68a3cbf693a2601854496ffd687334c205bcc0e52811ef9c552d0641c01\",\"vout\":1}]" "[{\"1GAFEtKWhwn5wQTt53kFMgd4b7xEyCxHHg\":0.00048961}]"

Generated transaction (unsigned) Decode on coinb.in shows no multisig details:

0200000001011c64d052c5f91e81520ecc5b204c3387d6ff96448501263a69bf3c8ac6c8630100000000ffffffff0141bf0000000000001976a914a6498450eb421d3926fcf12366e5abe2e7dfb93688ac00000000

After signing there are still no details about multisig shown on coinb.in, using bitcoind v0.16.3 the transaction itself is shown as type multisig correctly. Any ideas how to get the same result using the latest bitcoind?

Update

Signing the transaction with 1 key:

'signrawtransactionwithkey',[
            "0200000001011c64d052c5f91e81520ecc5b204c3387d6ff96448501263a69bf3c8ac6c8630100000000ffffffff0141bf0000000000001976a914a6498450eb421d3926fcf12366e5abe2e7dfb93688ac00000000",
            [
                "privkey",
            ],
            [
                "txid"              => "63c8c68a3cbf693a2601854496ffd687334c205bcc0e52811ef9c552d0641c01",
                "vout"              => 1,
                "scriptPubKey"      => "a9147b3c11ea9596776b98f1d7e68ffcf891e860216f87",
                "redeemScript"      => "522102ab224d0d8de7d5ad5568bf4f66b9c29ea7afd0f196176f9b09a311c11da6377e21037b3ccfb03f8dc58598619b2f3a91e33012444469fc69b4459760d04c20c4d69c21034254badc6cd5c4fa4e0ca10fb88d289bd7260331c5355ec2361312eafb26eb6753ae",
                "amount"            => 0.00053938,
            ],
        ]

Returns:

{
"result":{
"hex":"0200000001011c64d052c5f91e81520ecc5b204c3387d6ff96448501263a69bf3c8ac6c86301000000b50047304402200e83a051845ff6d5d20fd9cab5c6e15e8ae99ab0b2ac14bcf991f4f3bad3b4a00220555c7c3d419e80165e8f42385b158ca01a125686e19bf01a522332c35e689dd701004c69522102ab224d0d8de7d5ad5568bf4f66b9c29ea7afd0f196176f9b09a311c11da6377e21037b3ccfb03f8dc58598619b2f3a91e33012444469fc69b4459760d04c20c4d69c21034254badc6cd5c4fa4e0ca10fb88d289bd7260331c5355ec2361312eafb26eb6753aeffffffff0141bf0000000000001976a914a6498450eb421d3926fcf12366e5abe2e7dfb93688ac00000000",
"complete":false,
"errors":[
{
"txid":"63c8c68a3cbf693a2601854496ffd687334c205bcc0e52811ef9c552d0641c01",
"vout":1,
"witness":[
],
"scriptSig":"0047304402200e83a051845ff6d5d20fd9cab5c6e15e8ae99ab0b2ac14bcf991f4f3bad3b4a00220555c7c3d419e80165e8f42385b158ca01a125686e19bf01a522332c35e689dd701004c69522102ab224d0d8de7d5ad5568bf4f66b9c29ea7afd0f196176f9b09a311c11da6377e21037b3ccfb03f8dc58598619b2f3a91e33012444469fc69b4459760d04c20c4d69c21034254badc6cd5c4fa4e0ca10fb88d289bd7260331c5355ec2361312eafb26eb6753ae",
"sequence":4294967295,
"error":"CHECK(MULTI)SIG failing with non-zero signature (possibly need more signatures)"
}
]
},
"error":null,
"id":null
}

Is the transaction itself signed correctly?

Transaction can be decoded using coinb.in but it says signed by 2 parts which is incorrect for sure.

Update 2

I tried to use importmulti before creating the transaction too:

'importmulti',
        [
            [
                [
                    'scriptPubKey'  => [
                        'address'   => "3Cvczsgf3JTCHSjPgRACCia5gtyQKJWng8",
                    ],
                    'timestamp'     => 'now',
                    'redeemscript'  => "522102ab224d0d8de7d5ad5568bf4f66b9c29ea7afd0f196176f9b09a311c11da6377e21037b3ccfb03f8dc58598619b2f3a91e33012444469fc69b4459760d04c20c4d69c21034254badc6cd5c4fa4e0ca10fb88d289bd7260331c5355ec2361312eafb26eb6753ae",
                    'watchonly'     => true,
                    'internal'      => false,

                ]
            ],
            [
                'rescan' => false
            ]
        ]));

        array:1 [▼
          0 => {#757 ▼
            +"success": true
          }
        ]

Doesn't change the generated transaction at all.

1 Answer 1

1

Bitcoind cannot tell it is a multisig input until it is signed. Prior to signing, all p2sh outputs are identical, and can be any script. Most commonly, it would either be a multisig or a p2sh-p2wsh, or a p2sh-p2wpkh, but an unsigned transaction does not contain enough information to differentiate between them.

If the script's redeemscript is known to your bitcoind instance (such as by being part of an active, loaded wallet), you might be able to get more information even prior to signing.

3
  • I included an update above, thanks a lot for the explanation. The reedemScript is known, I already included it into my update using signrawtransaction().
    – t0berius
    Feb 11, 2020 at 8:54
  • You know the redeemScript, but the bitcoind wallet does not. Even though you created the multisig and passed the redeemScript using Core, none of the information is stored in the wallet unless you explicitly do so using addmultisigaddress or importscript/importmulti.
    – Andrew Chow
    Feb 11, 2020 at 18:00
  • @Andrew Chow Thanks for your reply, I already used importmulti before, since I need to watch the address for incoming payments. See first post (edited it). Any ideas where the problem may be located? importscript isn't found at all and addmultisigaddress should only be used for non-watchonly addresses
    – t0berius
    Feb 19, 2020 at 11:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.