Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: mav on July 12, 2012, 06:45:07 AM



Title: Using multisig (testnet)
Post by: mav on July 12, 2012, 06:45:07 AM
Today I had a quick experiment with multisig on the testnet, a 'hello world' of sorts, and have some questions.

Assumed knowledge is from this thread about multisig.
https://bitcointalk.org/index.php?topic=82213.0 (https://bitcointalk.org/index.php?topic=82213.0)

Some background:

I have two machines running bitcoind. The address I use from each of them is as below

address - n4n3p9eU2VsmjL7E2v2sYJUFEDybQ9KWJu
public key - 02b1ebcdbac723f7444fdfb8e83b13bd14fe679c59673a519df6a1038c07b719c6

address - mzdVDLcMRBzLBjhRzNNWcq9C8xSgdmEPe3
public key - 036e69a3e7c303935403d5b96c47b7c4fa8a80ca569735284a91d930f0f49afa86

I used these to create a multisig address:

bitcoind addmultisigaddress 1 '["036e69a3e7c303935403d5b96c47b7c4fa8a80ca569735284a91d930f0f49afa86", "02b1ebcdbac723f7444fdfb8e83b13bd14fe679c59673a519df6a1038c07b719c6"]'

This produces the address 2N5vbPQB7pMqyVa8JRcpZdCQLQCwDZCMyfo

The address validates.

Questions:

My understanding of multisig as it stands is that you can send to a multisig address, but you can't spend from it (see first link in post). Does this mean that funds received at 2N5vbPQB:- cannot be spent at all?

I sent 0.002 BTC to the address to see if it would receive, and thus so I could try to spend them using multisig, and so far (an hour after the send) it has not received the coins even for zero confirmations.

bitcoind getreceivedbyaddress 2N5vbPQB7pMqyVa8JRcpZdCQLQCwDZCMyfo 0
0.00000000

The blockexplorer link to the transaction in question is http://blockexplorer.com/testnet/tx/16e7756fb3ba1994d1f88043b3af0cd0d24e4eb6fb905a377b153668d3f7a043 (http://blockexplorer.com/testnet/tx/16e7756fb3ba1994d1f88043b3af0cd0d24e4eb6fb905a377b153668d3f7a043)

Am I right in expecting that the address should have 0.002 coins in it?

Where can I find more information about how to spend these coins and when/how they will be spendable; or if I am wrong about this, an explanation to fill in my knowledge gap?

How am I able to better track / analyse this scenario beyond the commands and websites I have already stated?

Is there an estimate for when multisig will be usable? Is it already usable? If it's already usable, can someone point me to the info I require to be able to use it?


Title: Re: Using multisig (testnet)
Post by: davout on July 12, 2012, 08:59:39 AM
IIRC you can receive coins but you can't yet spend them on a multisig address using the stock client.
I'm very interested in using multisig too.


Title: Re: Using multisig (testnet)
Post by: mav on July 12, 2012, 09:22:13 AM
IIRC you can receive coins but you can't yet spend them on a multisig address using the stock client.
I'm very interested in using multisig too.

Any ideas why the above multisig address isn't showing any balance (ie why it isn't receiving coins)?

Some details about my bitcoind

Code:
{
    "version" : 60200,
    "protocolversion" : 60001,
    "walletversion" : 60000,
    "balance" : 0.31974163,
    "blocks" : 70864,
    "connections" : 8,
    "proxy" : "",
    "difficulty" : 0.06249911,
    "testnet" : true,
    "keypoololdest" : 1340586446,
    "keypoolsize" : 101,
    "paytxfee" : 0.00000000,
    "errors" : ""
}


Title: Re: Using multisig (testnet)
Post by: Pieter Wuille on July 12, 2012, 11:36:25 AM
You should be able to spend coins sent to a multisig address, if your client knows the multisig address, and has all involved keys.


Title: Re: Using multisig (testnet)
Post by: Gavin Andresen on July 12, 2012, 12:23:58 PM
Am I right in expecting that the address should have 0.002 coins in it?
Yes.
Quote
Where can I find more information about how to spend these coins and when/how they will be spendable; or if I am wrong about this, an explanation to fill in my knowledge gap?
As Pieter said, they don't count towards your wallet balance because you don't have ALL of the private keys in your wallet.

It is not clear which wallet those 1-of-2 coins belong to, since neither has exclusive control over them. So the code is conservative and doesn't add them to your balance unless you have ALL of the private keys.

Quote
Is there an estimate for when multisig will be usable? Is it already usable? If it's already usable, can someone point me to the info I require to be able to use it?
The 0.7 release will have a set of RPC calls to create and sign transactions that spend from multisig inputs: see https://gist.github.com/2839617



Title: Re: Using multisig (testnet)
Post by: mav on July 12, 2012, 12:34:07 PM
You should be able to spend coins sent to a multisig address, if your client knows the multisig address, and has all involved keys.

I'm just hoping to clear up a seemingly obvious question here - doesn't a client having all involved keys mean there is only one wallet involved in the multisig, which defeats the point of multisig (ie that verification from two different sources are required)? I seem to be missing something here, can someone please help me understand this?

On blockexplorer the 'to address' field for the transaction is displayed as "Unknown" with type "Strange" - where "Strange" is defined by blockexplorer as "'Strange' is an unusual transaction not created by the official Bitcoin client." - yet this was created by the official bitcoin client. Is this because blockexplorer is running a slightly older (non multisig) bitcoind?

The address on blockexplorer also gives "No results". The transferred amount is no longer in the wallet it was sent from, and also not in the wallet it was sent to. Any ideas where that 0.002 btc is?

edit: Thanks for the extra info Gavin, I'll have a look at the gist.


Title: Re: Using multisig (testnet)
Post by: [Tycho] on July 25, 2012, 11:42:39 AM
The 0.7 release will have a set of RPC calls to create and sign transactions that spend from multisig inputs: see https://gist.github.com/2839617
Will that 0.7 release contain a GUI element for creating/copying/exporting pubkeys for given or created address ?
Otherwise no public service will be able to create multisig addresses for receiving funds from normal users - if I'm understanding this correctly ?


Title: Re: Using multisig (testnet)
Post by: ikbrunel on February 12, 2013, 04:08:44 AM
What about spending from a multi-sig address? Could someone point me towards a gist showing how to spend from a multi-sig address?


Title: Re: Using multisig (testnet)
Post by: dserrano5 on February 12, 2013, 08:12:10 AM
What about spending from a multi-sig address? Could someone point me towards a gist showing how to spend from a multi-sig address?

You can try this: https://gist.github.com/gavinandresen/3966071


Title: Re: Using multisig (testnet)
Post by: monsterer on September 04, 2013, 07:32:27 AM
Did you ever resolve this problem?

I'm having exactly the same issue - i.e. coins sent to a multi-sig address never arrive.