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:
createrawtransaction
'[
{"txid":"03a4ffcc792525b4ddaecc05054114f2ad8aff8b7563cd41cdb496e2177d0117","vout":0},
{"txid":"03a4ffcc792525b4ddaecc05054114f2ad8aff8b7563cd41cdb496e2177d0116","vout":0}
]'
'{"mwCwTceJvYV27KXBc3NJZys6CjsgsoeHmf":0.05}'
The result of this call I use for signing:
signrawtransaction
020000000117017d17e296b4cd41cd63758bff8aadf214410505ccaeddb4252579ccffa4030000000000ffffffff0100b4c404000000001976a914ac19d3fd17710e6b9a331022fe92c693fdf6659588ac00000000
'[
{"txid":"03a4ffcc792525b4ddaecc05054114f2ad8aff8b7563cd41cdb496e2177d0117","vout":0,"scriptPubKey":"a91421ce1507d06ed2742be0bf18a018bbcdd812a26487","redeemScript":"00149835f2e0dff9d7f6a4060140696bc7e00b12edd5"},
{"txid":"13a4ffcc792525b4ddaecc05054114f2ad8aff8b7563cd41cdb496e2177d0116","vout":0,"scriptPubKey":"b91421ce1507d06ed2742be0bf18a018bbcdd812a26486","redeemScript":"10149835f2e0dff9d7f6a4060140696bc7e00b12edd6"}
]'
'["cMahea7zqjxryy6NWaKxmhDyb1JzuNKCZAg8sxaJoXSBkRXjnib9"]'
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.
UPDATE:
Latest unsigned raw transaction in BTC live net:
020000000195b96fa7fff141564feba34cb669bdeb94953c98ae864465623def3fbe9e9fb10100000000ffffffff01e87a0100000000001976a914d05bddfbc9059d06168b7bf08bd20d5f1fdaf79588ac00000000