I tried experimenting with Multisig and followed
Gavin's example, running Bitcoin-qt v0.8.3 and using the debug console.
However, I could not get it to work.
I'm using the following 3 keys, all generated in my bitcoin-qt wallet:
privkey: L2JjrJNUJjLwLHcLShFsbJVt6KuWqE3svqMUrfwbNJXgssujVWgV
pubkey: 02fff1a3da4dbc93d10fba4791689411a17d8308770f9cf6ea5854358441df6bc2
privkey: L1HKChJArnfKpApV7Cz7HEw9c5YKHRr9BwWtFf6f8RYmnyDXrq87
pubkey: 02a06a164106420bcc36908700af4dccc727b1e834f7424f1627623523d6751d10
privkey: L1hbxmK8H4dkk2dyHpNEN7H7RvAhaJnQUH27cdC4yAtAjQ1TNkdA
pubkey: 037bac6d147cd915b74f51c0e839d5345d816b2ab70da0a862b5bef6ab6d7f1123
I created a multisig address:
createmultisig 2 '["02fff1a3da4dbc93d10fba4791689411a17d8308770f9cf6ea5854358441df6bc2","02a06a164106420bcc36908700af4dccc727b1e834f7424f1627623523d6751d10","037bac6d147cd915b74f51c0e839d5345d816b2ab70da0a862b5bef6ab6d7f1123"]'
{
"address" : "3P1TEdL5DJYeRTSxYsaR4onfjQyZrQ5oGL",
"redeemScript" : "522102fff1a3da4dbc93d10fba4791689411a17d8308770f9cf6ea5854358441df6bc22102a06a164106420bcc36908700af4dccc727b1e834f7424f1627623523d6751d1021037bac6d147cd915b74f51c0e839d5345d816b2ab70da0a862b5bef6ab6d7f112353ae"
}
Went on to fund it (with the GUI). Details of funding transaction (
https://blockchain.info/tx/683e77cbac7356bab448a90a0f652ab68314c1b026833431cd56abaf40d6031b):
decoderawtransaction 0100000001d97502e9eee14adedc356a000c8e506d1e62e49242c7519281410d6cacde91d11d0000006b483045022100f4dfccaa5871a28f2843e0179142693963c24ead8b8e7238fca1fe989d56debd02201526d623fcb53b1c295116eee655b800c7dc8f29f32d7eed2fe4974c4c2ae2df012102095d1ffb1a31b9adceb15d006230b1987e34a6816680ac9e8917019a5445a360ffffffff0232082a00000000001976a91498070b4f2c6f333ed11396830c9932d84ef9e2c788ac40420f000000000017a914e9d7420b3e02e16089372cd9b9c77c58b3e133248700000000
{
"txid" : "683e77cbac7356bab448a90a0f652ab68314c1b026833431cd56abaf40d6031b",
"version" : 1,
"locktime" : 0,
"vin" : [
{
"txid" : "d191deac6c0d41819251c74292e4621e6d508e0c006a35dcde4ae1eee90275d9",
"vout" : 29,
"scriptSig" : {
"asm" : "3045022100f4dfccaa5871a28f2843e0179142693963c24ead8b8e7238fca1fe989d56debd02201526d623fcb53b1c295116eee655b800c7dc8f29f32d7eed2fe4974c4c2ae2df01 02095d1ffb1a31b9adceb15d006230b1987e34a6816680ac9e8917019a5445a360",
"hex" : "483045022100f4dfccaa5871a28f2843e0179142693963c24ead8b8e7238fca1fe989d56debd02201526d623fcb53b1c295116eee655b800c7dc8f29f32d7eed2fe4974c4c2ae2df012102095d1ffb1a31b9adceb15d006230b1987e34a6816680ac9e8917019a5445a360"
},
"sequence" : 4294967295
}
],
"vout" : [
{
"value" : 0.02754610,
"n" : 0,
"scriptPubKey" : {
"asm" : "OP_DUP OP_HASH160 98070b4f2c6f333ed11396830c9932d84ef9e2c7 OP_EQUALVERIFY OP_CHECKSIG",
"hex" : "76a91498070b4f2c6f333ed11396830c9932d84ef9e2c788ac",
"reqSigs" : 1,
"type" : "pubkeyhash",
"addresses" : [
"1Err9baeyDLCqundwncXonx8ea1v1WmS5o"
]
}
},
{
"value" : 0.01000000,
"n" : 1,
"scriptPubKey" : {
"asm" : "OP_HASH160 e9d7420b3e02e16089372cd9b9c77c58b3e13324 OP_EQUAL",
"hex" : "a914e9d7420b3e02e16089372cd9b9c77c58b3e1332487",
"reqSigs" : 1,
"type" : "scripthash",
"addresses" : [
"3P1TEdL5DJYeRTSxYsaR4onfjQyZrQ5oGL"
]
}
}
]
}
And then tried to spend funds from the multisig address:
createrawtransaction '[{"txid":"683e77cbac7356bab448a90a0f652ab68314c1b026833431cd56abaf40d6031b","vout":1,"scriptPubKey":"a914e9d7420b3e02e16089372cd9b9c77c58b3e1332487","redeemscript":"522102fff1a3da4dbc93d10fba4791689411a17d8308770f9cf6ea5854358441df6bc22102a06a164106420bcc36908700af4dccc727b1e834f7424f1627623523d6751d1021037bac6d147cd915b74f51c0e839d5345d816b2ab70da0a862b5bef6ab6d7f112353ae"}]' '{"1BBsbEq8Q29JpQr4jygjPof7F7uphqyUCQ":0.0002}'
01000000011b03d640afab56cd31348326b0c11483b62a650f0aa948b4ba5673accb773e680000000000ffffffff01204e0000000000001976a9146fbfa5eb9cf96799b0ff7d25f9e3ea9e4323db5988ac00000000
signrawtransaction '01000000011b03d640afab56cd31348326b0c11483b62a650f0aa948b4ba5673accb773e680100000000ffffffff01204e0000000000001976a9146fbfa5eb9cf96799b0ff7d25f9e3ea9e4323db5988ac00000000' '[{"txid":"683e77cbac7356bab448a90a0f652ab68314c1b026833431cd56abaf40d6031b","vout":1,"scriptPubKey":"a914e9d7420b3e02e16089372cd9b9c77c58b3e1332487","redeemscript":"522102fff1a3da4dbc93d10fba4791689411a17d8308770f9cf6ea5854358441df6bc22102a06a164106420bcc36908700af4dccc727b1e834f7424f1627623523d6751d1021037bac6d147cd915b74f51c0e839d5345d816b2ab70da0a862b5bef6ab6d7f112353ae"}]' '["L2JjrJNUJjLwLHcLShFsbJVt6KuWqE3svqMUrfwbNJXgssujVWgV"]'
Missing redeemScript (code -3)
When trying to sign all I get is the error message "Missing redeemScript (code -3)", even though the redeemScript for the multisig address is included in the data. Same thing happens if I use a different privkey format.
If I don't specify privkeys at all, nothing happens, even though the needed keys are in the unlocked wallet:
signrawtransaction '01000000011b03d640afab56cd31348326b0c11483b62a650f0aa948b4ba5673accb773e680100000000ffffffff01204e0000000000001976a9146fbfa5eb9cf96799b0ff7d25f9e3ea9e4323db5988ac00000000' '[{"txid":"683e77cbac7356bab448a90a0f652ab68314c1b026833431cd56abaf40d6031b","vout":1,"scriptPubKey":"a914e9d7420b3e02e16089372cd9b9c77c58b3e1332487","redeemscript":"522102fff1a3da4dbc93d10fba4791689411a17d8308770f9cf6ea5854358441df6bc22102a06a164106420bcc36908700af4dccc727b1e834f7424f1627623523d6751d1021037bac6d147cd915b74f51c0e839d5345d816b2ab70da0a862b5bef6ab6d7f112353ae"}]'
{
"hex" : "01000000011b03d640afab56cd31348326b0c11483b62a650f0aa948b4ba5673accb773e680100000000ffffffff01204e0000000000001976a9146fbfa5eb9cf96799b0ff7d25f9e3ea9e4323db5988ac00000000",
"complete" : false
}
Any ideas what the problem is?