I've been trying to spend from a 2of3 multisig address, using the same procedure as from this gist:
https://gist.github.com/gavinandresen/3966071When trying to sign I get the "error": "Operation not valid with the current stack size"
What's really strange is I did this exact procedure some time in October 2015 and it worked. I must've been using a version of core around 0.10.2 or 0.11.0. If nobody has any idea I can try downgrading to one of those versions and seeing if it works.
Here's what I did:
Generated 3 keypairs (privkey, pubkey and address)
cMpfNfuasJcrCv8RKMG35C8YtUVpaheFbNMwDuBXVvdcjaeYE7oh
024c5965fb18701569ec09e8d2979c45e3d6e0c60ddb3c9d6af0692124d3890e8a
mgMZZtLSX1cU9jhAdQWMqMyoPv4JncZqcU
cVM5Kaoim2MKzT8MxVHHAu9BixJKTJgMhqape1eHgjHGhFPkf2mn
03c9084cf82f74f764829a7d3c842462e03f4bbaf59981cb3b98cd3974438e5771
mrdkuGp2wcXhcmtN7RwwUs7CYevJpYuLnV
cU4mHYwU2X1oTWBfYBGYFN69oYdrpWnBMrWd4nCoeRPUzmRY89vM
0256d87a1997bad87ebdd409a3437ecec02885300a1bb0a1159e289ae66af78b34
mospdWZdHtym59yMwUUi8w4HcWQxd7sQsv
Create 2of3 multisig address
createmultisig 2 '["024c5965fb18701569ec09e8d2979c45e3d6e0c60ddb3c9d6af0692124d3890e8a","03c9084cf82f74f764829a7d3c842462e03f4bbaf59981cb3b98cd3974438e5771","0256d87a1997bad87ebdd409a3437ecec02885300a1bb0a1159e289ae66af78b34"]'
{
"address": "2N9nn3aMYzTjs2ccTRAvDUmdKykL9YjM2cj",
"redeemScript": "5221024c5965fb18701569ec09e8d2979c45e3d6e0c60ddb3c9d6af0692124d3890e8a2103c9084cf82f74f764829a7d3c842462e03f4bbaf59981cb3b98cd3974438e5771210256d87a1997bad87ebdd409a3437ecec02885300a1bb0a1159e289ae66af78b3453ae"
}
Import address and fund it
importaddress 2N9nn3aMYzTjs2ccTRAvDUmdKykL9YjM2cj "" false
//sent 0.1btc to 2N9nn3aMYzTjs2ccTRAvDUmdKykL9YjM2cj
listunspent
[
{
"txid": "ff65917ac6cbe36d55893d9e1ce63cad1140c2ab38e9c7d099170b16d1a55d70",
"vout": 0,
"address": "2N9nn3aMYzTjs2ccTRAvDUmdKykL9YjM2cj",
"account": "",
"scriptPubKey": "a914b579aabfd350ed75ee056ff4d6d56718c74f55df87",
"amount": 0.10000000,
"confirmations": 1,
"spendable": false,
"solvable": false
},
Create spending tx, sending to mqZa1zbDg5RHVYbX6ea1QxPuuxAyuGVSoK
createrawtransaction '[{"txid":"ff65917ac6cbe36d55893d9e1ce63cad1140c2ab38e9c7d099170b16d1a55d70","vout":0,"scriptPubKey":"a914b579aabfd350ed75ee056ff4d6d56718c74f55df87","redeemScript":"5221024c5965fb18701569ec09e8d2979c45e3d6e0c60ddb3c9d6af0692124d3890e8a2103c9084cf82f74f764829a7d3c842462e03f4bbaf59981cb3b98cd3974438e5771210256d87a1997bad87ebdd409a3437ecec02885300a1bb0a1159e289ae66af78b3453ae"}]' '{"mqZa1zbDg5RHVYbX6ea1QxPuuxAyuGVSoK":0.0999}'
0100000001705da5d1160b1799d0c7e938abc24011ad3ce61c9e3d89556de3cbc67a9165ff0000000000ffffffff01706f9800000000001976a9146e2fe8ef5dcb05fd258e2f51d3f15ba3781cd96b88ac00000000
decoderawtransaction 0100000001705da5d1160b1799d0c7e938abc24011ad3ce61c9e3d89556de3cbc67a9165ff0000000000ffffffff01706f9800000000001976a9146e2fe8ef5dcb05fd258e2f51d3f15ba3781cd96b88ac00000000
{
"txid": "a8cfe9dd4fb8534caf4236b8fdf87d28aee5d74154eb88dab60c4de865bebfea",
"hash": "a8cfe9dd4fb8534caf4236b8fdf87d28aee5d74154eb88dab60c4de865bebfea",
"size": 85,
"vsize": 85,
"version": 1,
"locktime": 0,
"vin": [
{
"txid": "ff65917ac6cbe36d55893d9e1ce63cad1140c2ab38e9c7d099170b16d1a55d70",
"vout": 0,
"scriptSig": {
"asm": "",
"hex": ""
},
"sequence": 4294967295
}
],
"vout": [
{
"value": 0.09990000,
"n": 0,
"scriptPubKey": {
"asm": "OP_DUP OP_HASH160 6e2fe8ef5dcb05fd258e2f51d3f15ba3781cd96b OP_EQUALVERIFY OP_CHECKSIG",
"hex": "76a9146e2fe8ef5dcb05fd258e2f51d3f15ba3781cd96b88ac",
"reqSigs": 1,
"type": "pubkeyhash",
"addresses": [
"mqZa1zbDg5RHVYbX6ea1QxPuuxAyuGVSoK"
]
}
}
]
}
Sign with the first privkey
signrawtransaction '0100000001705da5d1160b1799d0c7e938abc24011ad3ce61c9e3d89556de3cbc67a9165ff0000000000ffffffff01706f9800000000001976a9146e2fe8ef5dcb05fd258e2f51d3f15ba3781cd96b88ac00000000' '[{"txid":"ff65917ac6cbe36d55893d9e1ce63cad1140c2ab38e9c7d099170b16d1a55d70","vout":0,"scriptPubKey":"a914b579aabfd350ed75ee056ff4d6d56718c74f55df87","redeemScript":"5221024c5965fb18701569ec09e8d2979c45e3d6e0c60ddb3c9d6af0692124d3890e8a2103c9084cf82f74f764829a7d3c842462e03f4bbaf59981cb3b98cd3974438e5771210256d87a1997bad87ebdd409a3437ecec02885300a1bb0a1159e289ae66af78b3453ae"}]' '["cMpfNfuasJcrCv8RKMG35C8YtUVpaheFbNMwDuBXVvdcjaeYE7oh"]'
{
"hex": "0100000001705da5d1160b1799d0c7e938abc24011ad3ce61c9e3d89556de3cbc67a9165ff00000000b5004830450221009d4f252bc47a8ab7078c3f93929bd091da175ed115bbe4953a3704d1e8027e12022005ab1434847d64bc6551ce6044b970becad36fc0cf6380847c33b241a30fc085014c695221024c5965fb18701569ec09e8d2979c45e3d6e0c60ddb3c9d6af0692124d3890e8a2103c9084cf82f74f764829a7d3c842462e03f4bbaf59981cb3b98cd3974438e5771210256d87a1997bad87ebdd409a3437ecec02885300a1bb0a1159e289ae66af78b3453aeffffffff01706f9800000000001976a9146e2fe8ef5dcb05fd258e2f51d3f15ba3781cd96b88ac00000000",
"complete": false,
"errors": [
{
"txid": "ff65917ac6cbe36d55893d9e1ce63cad1140c2ab38e9c7d099170b16d1a55d70",
"vout": 0,
"scriptSig": "004830450221009d4f252bc47a8ab7078c3f93929bd091da175ed115bbe4953a3704d1e8027e12022005ab1434847d64bc6551ce6044b970becad36fc0cf6380847c33b241a30fc085014c695221024c5965fb18701569ec09e8d2979c45e3d6e0c60ddb3c9d6af0692124d3890e8a2103c9084cf82f74f764829a7d3c842462e03f4bbaf59981cb3b98cd3974438e5771210256d87a1997bad87ebdd409a3437ecec02885300a1bb0a1159e289ae66af78b3453ae",
"sequence": 4294967295,
"error": "Operation not valid with the current stack size"
}
]
}
As far as I can tell, everything is done in exactly the same was as in Gavin's gist from 2012, and I did this procedure in October 2015 and it worked.