Author

Topic: Help trying to send multisig raw transaction (Read 1368 times)

staff
Activity: 4284
Merit: 8808
April 05, 2015, 05:20:08 AM
#8
Public keys can be 'compressed', private keys are just private keys and can't be compressed.
Private keys have a flag to indicate if they're to be used with compression or not, as the compressed/uncompressed pubkeys are distinct; the flags are needed to make the private keys distinct too.
legendary
Activity: 2097
Merit: 1070
Thanks Grue! So that first batch I was using bitaddress to generate the key pairs which explains why I why mixing up the compress and uncompressed private keys. Thanks for pointing this out, I didn't even think about this. The successful runs I did afterwards I created the key pairs in bitcoin core, much easier, less margin for error.

This is just for clarification for future readers as you've probably already realised what I'm about to write.

Public keys can be 'compressed', private keys are just private keys and can't be compressed.

legendary
Activity: 1442
Merit: 1186
Thanks Grue! So that first batch I was using bitaddress to generate the key pairs which explains why I why mixing up the compress and uncompressed private keys. Thanks for pointing this out, I didn't even think about this. The successful runs I did afterwards I created the key pairs in bitcoin core, much easier, less margin for error.
legendary
Activity: 2058
Merit: 1452
Alright got it to work with help from that link you sent and this vid: https://www.youtube.com/watch?v=ZKRLJGBMqWo

I had to start all over and was able to send from a new multisig address using the console. I couldn't get the original multisig address to send, appears to be an issue when I created it I assume? Anyways if anyone really wants 25 cents worth of BTC and thinks they can figure it out all the private keys and transaction info is in the original post  Wink
I managed to get the original set to work. The trick is that the public keys you used to create the multisig transaction was compressed, and you tried to sign with the uncompressed key, causing it to fail. I signed the transaction again with compressed private keys (starting with "K") and it worked.

Code:
signrawtransaction '010000000111c546dc025a43c3a2ef8bd0860ba104edf484d4836f62f76b850b64c975ef950000000000ffffffff0118730100000000001976a914925e70c3f5a6922d8cbd593399f41ff077eada8288ac00000000' '[{"txid":"95ef75c9640b856bf7626f83d484f4ed04a10b86d08befa2c3435a02dc46c511","vout":0,"scriptPubKey":"a9140771fd34e1f24a620939bda6e399ab52a71434a187","redeemScript":"5221031d7c97b6b901ee97c191ef6b12e8b9d7d3ddfff122b203a5feb4d4aa274eab3521033df3003f8c8830c150979c554a046d993e602321cd1a0ff347335b28b27106ad2102a5a216f1f43da7e2dd9db1db05325f79b6c729c7936cf97b83bc2e4046089d8e53ae"}]' '["KwSKFvVH4yVzGggwNpc8t5VgD7Bvf2hoFuiEAELkUsgvEwyqDM5g"]'
{
"hex" : "010000000111c546dc025a43c3a2ef8bd0860ba104edf484d4836f62f76b850b64c975ef9500000000b500483045022100fc2e7126e7ef3e8078b931217445a1ee635780fa45c45bbfce83ed64f8b17a430220021d5c28d5b9b20172c3bb9eb70a27aa8dfe1c72c27d3b0f4c918b13486c54dc014c695221031d7c97b6b901ee97c191ef6b12e8b9d7d3ddfff122b203a5feb4d4aa274eab3521033df3003f8c8830c150979c554a046d993e602321cd1a0ff347335b28b27106ad2102a5a216f1f43da7e2dd9db1db05325f79b6c729c7936cf97b83bc2e4046089d8e53aeffffffff0118730100000000001976a914925e70c3f5a6922d8cbd593399f41ff077eada8288ac00000000",
"complete" : false
}

signrawtransaction '010000000111c546dc025a43c3a2ef8bd0860ba104edf484d4836f62f76b850b64c975ef9500000000b500483045022100fc2e7126e7ef3e8078b931217445a1ee635780fa45c45bbfce83ed64f8b17a430220021d5c28d5b9b20172c3bb9eb70a27aa8dfe1c72c27d3b0f4c918b13486c54dc014c695221031d7c97b6b901ee97c191ef6b12e8b9d7d3ddfff122b203a5feb4d4aa274eab3521033df3003f8c8830c150979c554a046d993e602321cd1a0ff347335b28b27106ad2102a5a216f1f43da7e2dd9db1db05325f79b6c729c7936cf97b83bc2e4046089d8e53aeffffffff0118730100000000001976a914925e70c3f5a6922d8cbd593399f41ff077eada8288ac00000000' '[{"txid":"95ef75c9640b856bf7626f83d484f4ed04a10b86d08befa2c3435a02dc46c511","vout":0,"scriptPubKey":"a9140771fd34e1f24a620939bda6e399ab52a71434a187","redeemScript":"5221031d7c97b6b901ee97c191ef6b12e8b9d7d3ddfff122b203a5feb4d4aa274eab3521033df3003f8c8830c150979c554a046d993e602321cd1a0ff347335b28b27106ad2102a5a216f1f43da7e2dd9db1db05325f79b6c729c7936cf97b83bc2e4046089d8e53ae"}]' '["Kytk1mTEQkeCwLzUH655aSKSbQWyAnm8zUNB4Vxj1PiPqK4PaR1K"]'
{
"hex" : "010000000111c546dc025a43c3a2ef8bd0860ba104edf484d4836f62f76b850b64c975ef9500000000fdfe0000483045022100fc2e7126e7ef3e8078b931217445a1ee635780fa45c45bbfce83ed64f8b17a430220021d5c28d5b9b20172c3bb9eb70a27aa8dfe1c72c27d3b0f4c918b13486c54dc01483045022100a8de43a9cd1625a353e718bf79042b0ee765b519119c668e7ebad507c97eef6c02205e168755aeaad28fcc53c8b53489488482fe47df71ab1beda34c73b9712e4d0b014c695221031d7c97b6b901ee97c191ef6b12e8b9d7d3ddfff122b203a5feb4d4aa274eab3521033df3003f8c8830c150979c554a046d993e602321cd1a0ff347335b28b27106ad2102a5a216f1f43da7e2dd9db1db05325f79b6c729c7936cf97b83bc2e4046089d8e53aeffffffff0118730100000000001976a914925e70c3f5a6922d8cbd593399f41ff077eada8288ac00000000",
"complete" : true
}
legendary
Activity: 1442
Merit: 1186
Alright got it to work with help from that link you sent and this vid: https://www.youtube.com/watch?v=ZKRLJGBMqWo

I had to start all over and was able to send from a new multisig address using the console. I couldn't get the original multisig address to send, appears to be an issue when I created it I assume? Anyways if anyone really wants 25 cents worth of BTC and thinks they can figure it out all the private keys and transaction info is in the original post  Wink
legendary
Activity: 1442
Merit: 1186
Yea I'm using the debug console as well, using the same steps. I must have made an error when creating the address, I can't think of any other reason why it is telling me "complete:false" after the second signature.  Huh

Well guess I'll start over and try again  Cheesy
legendary
Activity: 2097
Merit: 1070
I did a multisig test last year sometime and I found the guide at the following URL allowed me to complete the taskwithout any issues.

Check it out : http://bitcoin.stackexchange.com/questions/6100/how-will-multisig-addresses-work

It uses bitcoind but that doesn't matter, I just did it in the QT wallet debug console at the time and it worked.
legendary
Activity: 1442
Merit: 1186
Basically I'm trying to do multisig.
I had no issue creating the multisig address, but sending the raw transaction seems to have me stuck.

createrawtransaction (seems to be success, I get the hash and no errors)

signrawtransaction (also seems good no errors)

my 2nd sign rawtransaction it produces another hash but it still shows "complete":false

I'm using this (https://gist.githubusercontent.com/gavinandresen/3966071/raw/1f6cfa4208bc82ee5039876b4f065a705ce64df7/TwoOfThree.sh) as a reference and looks like it should say complete:true after the 2nd signing. What am I doing wrong?
I tried to sendrawtransaction just in case with the hash it gave me but error.

Here's my info, I'm not worried about anyone having these private keys or stealing the 25 cents worth of BTC in this multisig address just trying to figure this out.

Code:
//3 public/private key pairs to create the multisig
a= 5JmRCnXCAEk9patpLQ6kGVMCw8zMqTwSQGmq2ees6qEcSqbQ3JQ(031D7C97B6B901EE97C191EF6B12E8B9D7D3DDFFF122B203A5FEB4D4AA274EAB35)
b = 5Hs9DSiJEb6fMKWSThErN66bFygddFtPGADxzpt9VX4cB2bZbVs(033DF3003F8C8830C150979C554A046D993E602321CD1A0FF347335B28B27106AD)
c = 5JRQnwUhCGn8gxHCAY4C1KsrJK1u9Za7LpSBtYV2pDPyNsmHMam(02A5A216F1F43DA7E2DD9DB1DB05325F79B6C729C7936CF97B83BC2E4046089D8E)

//Entered this code into the console

createmultisig 2
'["031D7C97B6B901EE97C191EF6B12E8B9D7D3DDFFF122B203A5FEB4D4AA274EAB35","033DF3003F8C8830C150979C554A046D993E602321CD1A0FF347335B28B27106AD","02A5A216F1F43DA7E2DD9DB1DB05325F79B6C729C7936CF97B83BC2E4046089D8E"]'

//console output the below

{
"address" : "32NPCzDQHLGf5Gfg2kb2Sep85NMrCZiEvG",
"redeemScript" : "5221031d7c97b6b901ee97c191ef6b12e8b9d7d3ddfff122b203a5feb4d4aa274eab3521033df3003f8c8830c150979c554a046d993e602321cd1a0ff347335b28b27106ad2102a5a216f1f43da7e2dd9db1db05325f79b6c729c7936cf97b83bc2e4046089d8e53ae"
}

//sent some BTC to this address, this is the txid

TXid = "95ef75c9640b856bf7626f83d484f4ed04a10b86d08befa2c3435a02dc46c511";

//create a raw transaction in the console:

createrawtransaction
'[{"txid":"95ef75c9640b856bf7626f83d484f4ed04a10b86d08befa2c3435a02dc46c511","vout":0,"scriptPubKey":
"a9140771fd34e1f24a620939bda6e399ab52a71434a187","redeemScript":"5221031d7c97b6b901ee97c191ef6b12e8b9d7d3ddfff122b203a5feb4d4aa274eab3521033df3003f8c8830c150979c554a046d993e602321cd1a0ff347335b28b27106ad2102a5a216f1f43da7e2dd9db1db05325f79b6c729c7936cf97b83bc2e4046089d8e53ae"}]'
'{"1J9ikqFuwrzPbczsDkquA9uVYeq6dEehsj":0.0008}'

//the create transaction outputs the below hash.

hash1:  010000000111c546dc025a43c3a2ef8bd0860ba104edf484d4836f62f76b850b64c975ef950000000000ffffffff0180380100000000001976a914bc20526aca4c47b805511abc6b81d4f15dc3f38c88ac00000000

//Do the first sign of the transaction using hash1

signrawtransaction '010000000111c546dc025a43c3a2ef8bd0860ba104edf484d4836f62f76b850b64c975ef950000000000ffffffff0180380100000000001976a914bc20526aca4c47b805511abc6b81d4f15dc3f38c88ac00000000'
'[{"txid":"95ef75c9640b856bf7626f83d484f4ed04a10b86d08befa2c3435a02dc46c511","vout":0,"scriptPubKey":
"a9140771fd34e1f24a620939bda6e399ab52a71434a187","redeemScript":"5221031d7c97b6b901ee97c191ef6b12e8b9d7d3ddfff122b203a5feb4d4aa274eab3521033df3003f8c8830c150979c554a046d993e602321cd1a0ff347335b28b27106ad2102a5a216f1f43da7e2dd9db1db05325f79b6c729c7936cf97b83bc2e4046089d8e53ae"}]'
'["5JmRCnXCAEk9patpLQ6kGVMCw8zMqTwSQGmq2ees6qEcSqbQ3JQ"]'

//First signtransaction outputs the below hash:

hash2: 010000000111c546dc025a43c3a2ef8bd0860ba104edf484d4836f62f76b850b64c975ef95000000006c004c695221031d7c97b6b901ee97c191ef6b12e8b9d7d3ddfff122b203a5feb4d4aa274eab3521033df3003f8c8830c150979c554a046d993e602321cd1a0ff347335b28b27106ad2102a5a216f1f43da7e2dd9db1db05325f79b6c729c7936cf97b83bc2e4046089d8e53aeffffffff0180380100000000001976a914bc20526aca4c47b805511abc6b81d4f15dc3f38c88ac00000000

//Now sign hash2 with another private key:

signrawtransaction '010000000111c546dc025a43c3a2ef8bd0860ba104edf484d4836f62f76b850b64c975ef95000000006c004c695221031d7c97b6b901ee97c191ef6b12e8b9d7d3ddfff122b203a5feb4d4aa274eab3521033df3003f8c8830c150979c554a046d993e602321cd1a0ff347335b28b27106ad2102a5a216f1f43da7e2dd9db1db05325f79b6c729c7936cf97b83bc2e4046089d8e53aeffffffff0180380100000000001976a914bc20526aca4c47b805511abc6b81d4f15dc3f38c88ac00000000'
'[{"txid":"95ef75c9640b856bf7626f83d484f4ed04a10b86d08befa2c3435a02dc46c511","vout":0,"scriptPubKey":
"a9140771fd34e1f24a620939bda6e399ab52a71434a187","redeemScript":"5221031d7c97b6b901ee97c191ef6b12e8b9d7d3ddfff122b203a5feb4d4aa274eab3521033df3003f8c8830c150979c554a046d993e602321cd1a0ff347335b28b27106ad2102a5a216f1f43da7e2dd9db1db05325f79b6c729c7936cf97b83bc2e4046089d8e53ae"}]'
'["5Hs9DSiJEb6fMKWSThErN66bFygddFtPGADxzpt9VX4cB2bZbVs"]'

//The second signing outputs this hash, but shows complete is false

hash3:
{
"hex" : "010000000111c546dc025a43c3a2ef8bd0860ba104edf484d4836f62f76b850b64c975ef95000000006e0000004c695221031d7c97b6b901ee97c191ef6b12e8b9d7d3ddfff122b203a5feb4d4aa274eab3521033df3003f8c8830c150979c554a046d993e602321cd1a0ff347335b28b27106ad2102a5a216f1f43da7e2dd9db1db05325f79b6c729c7936cf97b83bc2e4046089d8e53aeffffffff0180380100000000001976a914bc20526aca4c47b805511abc6b81d4f15dc3f38c88ac00000000",
"complete" : false
}

//When trying to send using the hex from the 3rd hash

sendrawtransaction 010000000111c546dc025a43c3a2ef8bd0860ba104edf484d4836f62f76b850b64c975ef95000000006e0000004c695221031d7c97b6b901ee97c191ef6b12e8b9d7d3ddfff122b203a5feb4d4aa274eab3521033df3003f8c8830c150979c554a046d993e602321cd1a0ff347335b28b27106ad2102a5a216f1f43da7e2dd9db1db05325f79b6c729c7936cf97b83bc2e4046089d8e53aeffffffff0180380100000000001976a914bc20526aca4c47b805511abc6b81d4f15dc3f38c88ac00000000

16: mandatory-script-verify-flag-failed (Script evaluated without error but finished with a false/empty top stack element) (code -26)

Jump to: