I received a raw tx:
{
"txid": "***********************",
"version": 2,
"locktime": 0,
"vin": [
...
],
"vout": [
...
{
"scriptpubkey": "a9***********************",
"scriptpubkey_asm": "OP_HASH160 OP_PUSHBYTES_20 20b6da29af9fc5a17b54946558c28eed2d5f1d48 OP_EQUAL",
"scriptpubkey_type": "p2sh",
"scriptpubkey_address": "34***********************",
"value": 1010000
},
...
],
"size": 3982,
"weight": 9082,
"sigops": 75,
...
}
And I was trying to spend those outputs this way:
inputs = [{"txid": txid, "vout": vout}]
where the txid and vout are replaced by the actual values.
then I used createrawtransaction (by providing inputs and outputs) and signrawtransactionwithkey (by providing tx_hex and privkeys).
However I got this response:
{'txid': '**************************', 'vout': 34, 'witness': [], 'scriptSig': '', 'sequence': **********, 'error': 'Unable to sign input, invalid stack size (possibly missing key)'}
Why? What's missing? Something related to the script?











