Bitcoin Forum
November 12, 2024, 05:38:48 AM *
News: Check out the artwork 1Dq created to commemorate this forum's 15th anniversary
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: What is the difference between createmultisig and addmultisigaddress?  (Read 221 times)
tsubasa1380 (OP)
Newbie
*
Offline Offline

Activity: 15
Merit: 4


View Profile
April 26, 2018, 07:07:24 AM
Last edit: April 26, 2018, 07:32:35 AM by tsubasa1380
Merited by suchmoon (1)
 #1

I use bitcoin core api and want to create multisigaddress with this api.

So I have two question about multisigaddress.

I created  2 multisigaddresses by different two commands;

*These address were '2 of 3' multisigaddresses.

One address was created by using 'createmultisig' command as follows.
bitcoin-cli createmultisig 2 '''
  [
    "publicKey_1", ← These were dummy keys
    "publicKey_2",
    "publicKey_3"
  ]
'''

Return multisigaddress and redeemscript.

Then I checked this address by validateaddress command.
bitcoin-cli validateaddress xxxxxxxxxxxxx  ←dummy multisig address
Return
{
  "isvalid": true,
  "address": "xxxxxxxxxxxxxxxxxx",
  "scriptPubKey": "a9142c3647f41008a9a4098155d5d9ccc29d66d10ae787",
  "ismine": false,
  "iswatchonly": false,  ← Why false ?
  "isscript": true
}

The other address was created by using 'addmultisigaddress' command as follows.

bitcoin-cli addmultisigaddress \
  2 \
  '''
    [
      "publicKey_4",  ← These were dummy keys
      "publicKey_5",
      "publicKey_6"
    ]
  '''
Return  multisigaddress.

Then I checked this address by validateaddress command.
bitcoin-cli validateaddress YYYYYYYYYYYYYYYYYYY  ←dummy multisig address
Return
{
  "isvalid": true,
  "address": "YYYYYYYYYYYYYYYYYYY",
  "scriptPubKey": "a914e435fa2df32285ab3f3532001ee8eae0173b6ab487",
  "ismine": true,         ← attention!
  "iswatchonly": false,
  "isscript": true,
  "script": "multisig",
  "hex": "5221037fb9d7a84228a2ad880e0ddb490f6b215d54d59b5da009eb6965213148941bed21025f78b 5a4bea95ad92a82bfbb1a9bae7e7ce631e425937fff0d2953c1543e19212102a6f29806b8340ed9 b512e463944b9b02f48c4ce0d0f49d87472caa03c0deae7e53ae",
  "addresses": [
    "singlesigaddress_1", ← These are dummy addresses by which I created multisigaddress
    "singlesigaddress_2",
    "singlesigaddress_3"
  ],
  "sigsrequired": 2,
  "account": ""
}

As mentioned above, "hex" is redeemscript and "address" consists of these three "addresses".


Q1  
What is the difference between createmultisig and addmultisigaddress?

Q2  
If I create multisigaddress by 'createmultisig' command and then forget private keys of this multisigaddress,
how can I get these private keys ?

Not knowing  these singlesig addresses, I can't use dumpprivkey command.

If aynone knows these question, please answear me.
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4361

<insert witty quote here>


View Profile
April 26, 2018, 07:55:25 AM
Merited by suchmoon (2), achow101 (2), ABCbits (2), Xynerise (2), bones261 (1)
 #2

The short answer is that createmultisig basically just combines the inputs and then outputs the constructed MultiSig (ie. redeemscript and address etc) onto the console...

Whereas, addmultisigaddress takes the inputs, constructs the MultiSig... and then stores it all in your wallet file for you.

This is why "ismine" is "True" after using addmultsigaddress, because it is now actually stored in your wallet. Whereas with createmultisig, it has just output the information for you, but nothing is saved to your wallet file, so "ismine" = false.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
tsubasa1380 (OP)
Newbie
*
Offline Offline

Activity: 15
Merit: 4


View Profile
April 26, 2018, 09:27:39 AM
 #3

The short answer is that createmultisig basically just combines the inputs and then outputs the constructed MultiSig (ie. redeemscript and address etc) onto the console...

Whereas, addmultisigaddress takes the inputs, constructs the MultiSig... and then stores it all in your wallet file for you.

This is why "ismine" is "True" after using addmultsigaddress, because it is now actually stored in your wallet. Whereas with createmultisig, it has just output the information for you, but nothing is saved to your wallet file, so "ismine" = false.

Thak you for your well understood answer.

I understood the difference between createmultisig command and addmultisigaddress command.

So I hava one more question.

If I create multisigaddress by using createmultisig command, is it true that nobodoy can get both privatekeys and redeemscript associated with this multisigaddress from this coins server ?

If so, this command is much more secure so log as I remember these privatekeys and redeemscript.

achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3542
Merit: 6886


Just writing some code


View Profile WWW
April 26, 2018, 03:14:47 PM
 #4

If I create multisigaddress by using createmultisig command, is it true that nobodoy can get both privatekeys and redeemscript associated with this multisigaddress from this coins server ?
If the private keys are not stored on the server, then yes. However there is no such security guarantee. Createmultisig just prevents the generated redeemScript from being added to your wallet; the private keys for the public keys in that redeemScript could still be part of the wallet.

tsubasa1380 (OP)
Newbie
*
Offline Offline

Activity: 15
Merit: 4


View Profile
April 26, 2018, 03:46:00 PM
 #5

If I create multisigaddress by using createmultisig command, is it true that nobodoy can get both privatekeys and redeemscript associated with this multisigaddress from this coins server ?
If the private keys are not stored on the server, then yes. However there is no such security guarantee. Createmultisig just prevents the generated redeemScript from being added to your wallet; the private keys for the public keys in that redeemScript could still be part of the wallet.
Thank you for your answer.

When I create multisigaddress by using 'createmultisig' command in my full node coin server which I built, is it possible to remove private keys associated with this multisigaddress
from this server for the purpose of security ?

If possible,how should I do ?
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3542
Merit: 6886


Just writing some code


View Profile WWW
April 26, 2018, 04:12:16 PM
 #6

Thank you for your answer.

When I create multisigaddress by using 'createmultisig' command in my full node coin server which I built, is it possible to remove private keys associated with this multisigaddress
from this server for the purpose of security ?

If possible,how should I do ?
No, you cannot delete private keys from a wallet. However, you can just run your coin server without a wallet which guarantees that there will not be private keys that are active on your server.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!