multisignature transaction, unable to sign #12239

issue ghost opened this issue on January 22, 2018
  1. ghost commented at 7:16 AM on January 22, 2018: none

    Describe the issue Unable to sign a multisignature transaction from 2 members.

    What behavior did you expect? Being able to sign the transaction.

    What version of Bitcoin Core are you using, where did you get it (website, self-compiled, etc)? v0.15.1

    I'm running bitcoind v0.15.1 on a ubuntu server. On my OS X I run the same version of bitcoin-qt. Both are running in testnet mode.

    I created a multisignature address (2 of 3 members are able to spend output of it).

    Private keys of all members and adresses used to generate the multisignature address:

    role: seller
    
    - address: mffSY9hWk75wuwJV33A2A9BzUTSacBSjyQ
    - Public Key: 02efb108823eb92640ff2c236bd56db8a207a9d24d341a5df9ea0d533804865551 
    - Private Key: cUNwo1GSKuuozKdECPF2CURBxgbNpBU7Y2zzgG5hbcUa4oKQQLaP
    
    role: buyer
    
    - address: mxuNdPbdhPjQztj3iRXWRWpdqgZDEk1W9H
    - Public Key: 020343ed06bcc3da89492d09b61d97236914be9a49b549a133aa2461169c0300c6
    - Private key: cMkwkVZvJeSbAnyksMWjVmbH5rfZUHrniEuGy7d1GjspnSqZqKN4
    
    role: admin
    
    -  address: mzphB1YDJeZLKf6u4bPxYhoTTZhwP3mVGf
    - Public Key: 021a1ae7bbcd0972b17b9bb0ed22642f4f67e64b7901fc2a41e7fa4eaf0cc7f388
    - Private Key: cUsdeDcSszM3mZ8dW4P8TvUTGAHF1dPHgJfyPiG3XYptmGzQndHE
    

    ./bitcoin-cli createmultisig 2 '["02efb108823eb92640ff2c236bd56db8a207a9d24d341a5df9ea0d533804865551","020343ed06bcc3da89492d09b61d97236914be9a49b549a133aa2461169c0300c6", "021a1ae7bbcd0972b17b9bb0ed22642f4f67e64b7901fc2a41e7fa4eaf0cc7f388"]'

    returns:

    {
      "address": "2Mxif1wuEXDdnKpNAM6gT2Updh1RhxWtxXJ",
      "redeemScript": "522102efb108823eb92640ff2c236bd56db8a207a9d24d341a5df9ea0d53380486555121020343ed06bcc3da89492d09b61d97236914be9a49b549a133aa2461169c0300c621021a1ae7bbcd0972b17b9bb0ed22642f4f67e64b7901fc2a41e7fa4eaf0cc7f38853ae"
    }
    
    

    Now after funding the address "2Mxif1wuEXDdnKpNAM6gT2Updh1RhxWtxXJ"... TXID: 0af26564867a2d59047bb78fe952713b090f8830ecae28119ee057bcffe382b2

     "vout": [
        {
          "value": 0.22000000,
          "n": 0,
          "scriptPubKey": {
            "asm": "OP_HASH160 3c08c0b5fcac2e08a2590956465b1037d81541b9 OP_EQUAL",
            "hex": "a9143c08c0b5fcac2e08a2590956465b1037d81541b987",
            "reqSigs": 1,
            "type": "scripthash",
            "addresses": [
              "2Mxif1wuEXDdnKpNAM6gT2Updh1RhxWtxXJ"
            ]
          }
        }, 
    

    Using this vout and create a new output, to let's say the seller address:

    creating this on bitcoind (using the wallet of admin):

    ./bitcoin-cli createrawtransaction '[{"txid":"0af26564867a2d59047bb78fe952713b090f8830ecae28119ee057bcffe382b2","vout":0}]' '{"mffSY9hWk75wuwJV33A2A9BzUTSacBSjyQ":0.200000000}'

    returns:

    0200000001b282e3ffbc57e09e1128aeec30880f093b7152e98fb77b04592d7a866465f20a0000000000ffffffff01002d3101000000001976a914019ae75fa7178659f2cf155c67594ade6e0aa6b588ac00000000

    Trying to sign this with admin key:

    bitcointestnet@vmd20621:~$ ./bitcoin-cli signrawtransaction 0200000001b282e3ffbc57e09e1128aeec30880f093b7152e98fb77b04592d7a866465f20a0000000000ffffffff01002d3101000000001976a914019ae75fa7178659f2cf155c67594ade6e0aa6b588ac00000000
    {
      "hex": "0200000001b282e3ffbc57e09e1128aeec30880f093b7152e98fb77b04592d7a866465f20a0000000000ffffffff01002d3101000000001976a914019ae75fa7178659f2cf155c67594ade6e0aa6b588ac00000000",
      "complete": false,
      "errors": [
        {
          "txid": "0af26564867a2d59047bb78fe952713b090f8830ecae28119ee057bcffe382b2",
          "vout": 0,
          "witness": [
          ],
          "scriptSig": "",
          "sequence": 4294967295,
          "error": "Operation not valid with the current stack size"
        }
      ]
    }
    

    Any idea where things go wrong?

  2. meshcollider commented at 9:34 AM on January 22, 2018: contributor

    When you use the createmultisig command, it does not add the redeemScript to your wallet, it just gives it to you. You need to use addmultisigaddress if you want to add it to your wallet. Thus, your wallet doesn't understand how to sign for that address, you should add the optional extra parameter to signrawtransaction prevtxs in which you can include the redeemScript for the output, so it knows how to sign it.

    In future, please direct usage questions to https://bitcoin.stackexchange.com not here, this is only for bugs/issues/feature requests for bitcoin core not for support :)

  3. ghost commented at 9:52 AM on January 22, 2018: none

    @MeshCollider

    First of all thanks for your reply. Including the reedemScript of the input transaction or the whole JSON output of the input transaction?

  4. sipa closed this on Jan 22, 2018

  5. 15811726527 commented at 10:24 AM on July 14, 2018: none

    Have you solved the problem

  6. 15811726527 commented at 10:25 AM on July 14, 2018: none

    ./qtum-cli --datadir=/mnt/qtumData/ --conf=/home/walletCore/.qtum/qtum.conf --gen --testnet signrawtransaction 02000000016e63b970813fba163b304d27856f94f0ca99f4e365477e48c0cc492e718ab1b70100000000ffffffff01802b530b000000001976a9140454a848cefef601f3b00fec91042826a6cc52e288ac00000000 { "hex": "02000000016e63b970813fba163b304d27856f94f0ca99f4e365477e48c0cc492e718ab1b70100000000ffffffff01802b530b000000001976a9140454a848cefef601f3b00fec91042826a6cc52e288ac00000000", "complete": false, "errors": [ { "txid": "b7b18a712e49ccc0487e4765e3f499caf0946f85274d303b16ba3f8170b9636e", "vout": 1, "witness": [ ], "scriptSig": "", "sequence": 4294967295, "error": "Operation not valid with the current stack size" } ] }

  7. DrahtBot locked this on Sep 8, 2021

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:15 UTC

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