Difference between createmultisig and addmultisigaddress?

2

What is the functional difference between createmultisig and addmultisigaddress in bitcoincore (v 0.10)?

To be clear, I understand how both function. ie. multisigCmd n ["address1 public key as hex", "address in Base58 format", "more JSON entries..."] (where n is the n of m value, and a JSON list of eiher hex pubkeys or Base58 addresses follows).

However, the output for the multisigCmd (createmultisig and addmultisigaddress, respectively) is:

  • createmultisig: ==> 3outputEqualsPay2scriptBTCAddress, script as hex
  • addmultisigaddress: ==> 3outputEqualsPay2scriptBTCAddress (no script!)

Both commands give identical output addresses (ie 3outputEqualsPay2scriptBTCAddress) when the same JSON data input is used. So the difference, really, is only that the former outputs the redeeming hex script. Am I missing something? Why the need for 2 commands rather than, for example, a single command with a -hex_script_output flag?

Wizard Of Ozzie

Posted 2015-02-14T14:07:54.307

Reputation: 4 535

Answers

4

  • createmultisig creates a P2SH multisig address for use in raw transactions. It outputs the redeem script because you'll need that to spend any payments sent to the P2SH address.

  • addmultisigaddress adds a P2SH multisig address to your Bitcoin Core wallet, allowing you to track and spend payments received by that address. It doesn't output the redeem script because Bitcoin Core stores that for you. (You can retrieve it later with validateaddress.)

David A. Harding

Posted 2015-02-14T14:07:54.307

Reputation: 10 154

Of course, that makes perfect sense. I've noticed the new v0.10 help function partitions the 2 functions under the Tx and Wallet categories, respectively. The categories would've clarified the query for me as past versions of help were not clearly delineatedWizard Of Ozzie 2015-02-15T01:09:32.243