Hello all,
I'm looking for how to make 2-of-3 multisig transactions. I was looking for a solution for a whole day but I just don't get it.
As I can understand the starting point is having three keypairs (let's suppose they are in form user/public key/private key):
1. Alice/AlicePublicKey/AlicePrivateKey. (Alice is actual buyer)
2. John/JohnPublicKey/JohnPrivateKey. (John is actual seller)
3. Ben/BenPublicKey/BenPrivateKey. (Ben holds the escrow)
This is input data, private key are not known by everyone at this point.
So, according to
Gavin's example, the first step is to create multisig address:
./bitcoind createmultisig 2 '["AlicePublicKey","JohnPublicKey","BenPublicKey"]'
OK. The output is:
{
"address" : "[b]3C1qwWFkRxuu7ConqheN1BXChDXMhXtH89[/b]",
"redeemScript" : "522103d5d32e915a2e6ba094b33614b317e79f270649c6203047de1df3702f24f99ffa2102cefd67d750ba01e5c34d00ffb7de1cd63f7c1ca1ee64ed4cd00e86e3840a12cd21034fc4f66fca3b82384d8c6f9eeaacda61aa29119d683680455baeb831542f2eda53ae"
}
Let's suppose that this is done for escrow purposes and Alice is buying something from John. So, here goes my first question. Can I use the address
3C1qwWFkRxuu7ConqheN1BXChDXMhXtH89 to put funds in this transaction? I mean, at this point, can I tell Alice "OK Alice, make the payment to address
3C1qwWFkRxuu7ConqheN1BXChDXMhXtH89. I guess the answer is yes, but I need confirmation.
This is the first part. Now the second part. Let's suppose the delivery goes smooth and now John needs to get the funds stored in the transaction. He asks Alice: "Hey, give me your private key", and Alice gives him AlicePrivateKey. Now John has two private keys: AlicePrivateKey and JohnPrivateKey (his own).
And now I get completely lost. What should John do in order to get his bitcoins? As long as I can understand it's not enough to have just two private keys and the address for the transaction. More data is required, what is that data?
By the way Gavin's example is fine. Only that, imho it does not apply to the real world, I mean, I get lost and confused when he uses all that low-level methods. What I need to know first is the minimum amount of infomation required to get the funds from the multisig transaction.
Thanks in advance.
P.D. I want to see how can this be achieved with
reference bitcoin client implementation.