Bitcoin Forum
December 06, 2016, 06:00:40 PM *
News: Latest stable version of Bitcoin Core: 0.13.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: [Bug?] 2-of-3 multisig address behaves as 3-of-3  (Read 1004 times)
grazcoin
Sr. Member
****
Offline Offline

Activity: 284



View Profile
July 07, 2012, 04:22:26 PM
 #1

Hello everyone!

Now, when I got white-listed, I can post it here:
I have been trying the multisig BIP 16 using the latest 0.6.3 client on Ubuntu 64 bit.
I was trying to create 2 from 3 sig address, but it behaves like 3 out of 3 sig address.

$ bitcoind addmultisigaddress 2 '["04d4f81d9c28413d3019a202e63a828c884dcaffa094a9e66fb8dec623a1445d3fe099ca7c3087c 13ac6b62ad7f547eff25df552e94e12f6fbfc4535c1c2b4b78a","0420c41cb722082943e7da602557b2e28a84ebad90bdfbae8499d9ae77a3752570d711649b2e54f 87b9064b7dc72f5f96203a782e82cfc08a5ac576d933ca92de1","04eb3fbbd85992aeb3ef8d752f733661349fcbfce2683200b90009c8b4e713ffd93da9fc7f840e2 2cca18ed6d66ed51cdca729586f0c5b17f9f4f3c493ba7cdab7"]'
3G2v3VJZ46fjgLMqEF3CzLq3k9FPMgauh4
$
$ bitcoind validateaddress 3G2v3VJZ46fjgLMqEF3CzLq3k9FPMgauh4
{
"isvalid" : true,
"address" : "3G2v3VJZ46fjgLMqEF3CzLq3k9FPMgauh4",
"isscript" : true,
"ismine" : false,
"script" : "multisig",
"addresses" : [
"12tbLXQkERTB6Sq99EHptWuWJJgXqkZb4z",
"18pu5kF3kf9N8Ft5xuTGD2v3EdB9Hahwgh",
"19ARwmH1H1QMFSjmB14fyA4QrZigiM8sNV"
],
"sigsrequired" : 2,
"account" : ""
}

I have sent 0.1 BTC to the 3G... address directly from instawallet: 3dd40692d5594ee1302c3a6fce4c9086af3324dfadabf97150c8c5ea7ff78f1a
as well as the following:
$ bitcoind sendtoaddress 3G2v3VJZ46fjgLMqEF3CzLq3k9FPMgauh4 0.05
6c2f5a608fb3ef3e64e728ad430f60bbd6857de662b152dc2ef55eb25fdf2e93

I have made a backup of wallet.dat before importing.
Then I imported the keys #1, #2, #3
$ bitcoind getbalance
0.21700000
$ bitcoind importprivkey 5Jm...
$ bitcoind getbalance
0.21700000
$ bitcoind importprivkey 5KQ...
$ bitcoind getbalance
0.21700000
$ bitcoind importprivkey 5Ji...
$ bitcoind getbalance
0.36700000
Also in a different order (#3, #2, #1) the result is the same:
$ bitcoind getbalance
0.21700000
$ bitcoind importprivkey 5Ji...
$ bitcoind importprivkey 5KQ...
$ bitcoind getbalance
0.21700000
$ bitcoind importprivkey 5Jm...
$ bitcoind getbalance
0.36700000

And also when I try to import #1, #3, #2  – same.

Did I miss something?
If there is a need, I could give the private keys (well, at least 2 of them, and to someone I trust ;-))

Grazcoin.

1481047240
Hero Member
*
Offline Offline

Posts: 1481047240

View Profile Personal Message (Offline)

Ignore
1481047240
Reply with quote  #2

1481047240
Report to moderator
1481047240
Hero Member
*
Offline Offline

Posts: 1481047240

View Profile Personal Message (Offline)

Ignore
1481047240
Reply with quote  #2

1481047240
Report to moderator
1481047240
Hero Member
*
Offline Offline

Posts: 1481047240

View Profile Personal Message (Offline)

Ignore
1481047240
Reply with quote  #2

1481047240
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1481047240
Hero Member
*
Offline Offline

Posts: 1481047240

View Profile Personal Message (Offline)

Ignore
1481047240
Reply with quote  #2

1481047240
Report to moderator
1481047240
Hero Member
*
Offline Offline

Posts: 1481047240

View Profile Personal Message (Offline)

Ignore
1481047240
Reply with quote  #2

1481047240
Report to moderator
1481047240
Hero Member
*
Offline Offline

Posts: 1481047240

View Profile Personal Message (Offline)

Ignore
1481047240
Reply with quote  #2

1481047240
Report to moderator
Pieter Wuille
Legendary
*
qt
Offline Offline

Activity: 1036


View Profile WWW
July 07, 2012, 07:14:48 PM
 #2

The reference client only lets you spend coins sent to a multisig addresses if you have all involved keys. That doesn't mean that the protocol requires this.

The current functionality is really just proof of concept, as the question of who "owns" coins in a multisig setting is not very well defined. In practice, you want to use it in a situation where not all required keys are available to a single system at all, and a different mechanism is needed to create, gather and combine the required signatures.

The 0.7.0 release will come with a 'raw transaction' API that allows signing unsigned or partially signed transactions, passing them around out of band, and when fully signed, broadcasted to the network.

aka sipa, core dev team

Tips and donations: 1KwDYMJMS4xq3ZEWYfdBRwYG2fHwhZsipa
Gavin Andresen
Legendary
*
qt
Offline Offline

Activity: 1652


Chief Scientist


View Profile WWW
July 08, 2012, 03:01:11 AM
 #3

Pieter is exactly right. The current code is extremely conservative with multisig addresses, only counting them as yours if the wallet contains all the private keys.

Loosening that to considering them yours if you have enough keys to spend might happen, although I am worried that might cause vulnerabilities for applications that make the implicit assumption that if they have the key necessary to spend that means nobody else can possibly spend those coins after 6 confirmations. If it is a 1of2 multisig that wouldn't be true.

How often do you get the chance to work on a potentially world-changing project?
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!