I´m trying to build a multisig transaction using RPC. Till now my code looks similar to this:

At first I get the unspend outputs calling listunspend()

With those UTXOs I´ll try to create the rawtransaction:


The result of this call I use for signing:


At this point I get the error Missing amount and I can´t figure out why. I´m not sure which values to use for the signrawtransaction() call. Should I use the same txid and vout values as for the createrawtransaction? Where do I get the correct scriptPubKey and redeemScript values from?

Note: the provided txid´s and addresses are only samples (maybe not valid) and not the ones I´m using for my code.


Latest unsigned raw transaction in BTC live net:


1 Answer 1


if you are on testnet/regtest, it is completely ok, to provide "correct" data (no need for masquerading). There is the famous 2-of-3 multisig from Gavin, which provides a step by step approach using RPC. This should give you the idea behind.

Generally you are correct, you would search for listunspents, take one of the transaction numbers, and see in the transaction, which unspent output you can use (usually it is a 0 or 1 for the first or second). And for sure this transaction should have some amount, that you can spend. Use "decoderawtransaction" to see the details of the tx. When you have created the tx with "createrawtransaction", then it returns a string of data, that can be used as parameter to the "sign" call.

  • Thanks for the link, I´ll go through it. decoding my rawtransaction it should have an amount, but this amount (why ever) seems not to be available while performing the signrawtransaction process. And my question would still be Where do I get the correct scriptPubKey and redeemScript values from? to correctly perform the signing step?
    – Michael
    Jun 15, 2018 at 9:39
  • After reading parts of the linked source it gets a bit clearer how multisig addresses seem to work. So the redeemScript seems to be the one of the initial multisigaddress. you know if there is any way to recover this data while only haveing access to 2 of the 3 private keys?
    – Michael
    Jun 15, 2018 at 9:58
  • Basically you have three steps: 1) create redeemscript and address, 2) fund this address; 3) spend from this address. The redeemscript is created out of three public keys. The "createmultisig" call would be provided with the parameters, and returns a hash of it (which is the new multi-sig address). And this hash is not reversible. So if you created such a multisig address, and lost the corresponding keys, you cannot easily re-create it. With highly sophisticated knowledge and effort, you could go through all the keys of involved wallet(s), and create appropriate combinations manually... Jun 15, 2018 at 19:16
  • after reading the guide I still get an error while trying to sign the rawtransaction. The decoded rawtransacion looks fine but while I try to sign it I get "Missing amount" even if in the decoded raw transaction the correct amount is displayed. For my approach I use the folling parameter: signrawtransaction([hex_from_createrawtransaction], [inputs_used_for_createrawtransaction(txid, vout, scriptPubKey, redeemScript)],[one_privateKey]). Anything wrong or missing?
    – Michael
    Jun 18, 2018 at 13:56
  • I try to follow each step: I looked up the tx, that you want to spend from - the second line in the signrawtransaction example above. This tx ID cannot be found on testnet. Same for the tx ending with "116" in createtransaction (testnet.blockchain.info). Only the tx ending with "117" has funds on it. The numbers in the (second) lines seem to be "to close", they are just incremented by 1 at specific positions - it might be correct, but I haven't seen this before. Can you try to go with a single input and output, using only the tx ending with "117"? Jun 18, 2018 at 14:24

Your Answer

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

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