<p>Say Alice and Bob are part of a partnership business that accepts Bitcoin. They store all their main funds in cold storage until the end of 3 months, when they cash out and use a new address. This cold storage is in a single address.</p>
<p>Both Alice and Bob have full nodes, running Bitcoin Core. They use the console feature to generate a 2-of-2 P2SH multisig address, using <code>addmultisignature</code>.</p>
<p>They exchange each other's public keys, and input them as arguments.</p>
<p>If Alice used the following syntax:</p>
<p><code>addmultisignature 2 '[&lt;alice's key&gt;,&lt;bob's key&gt;]'</code></p>
<p>and Bob used:</p>
<p><code>addmultisignature 2 '[&lt;bob's key&gt;,&lt;alice's key&gt;]'</code></p>
<p>Will they end up with the script hash and address?</p>
<p><em>Follow up questions:</em></p>
<p>Can you give certain keys more &quot;weighting&quot; by specifying them more than once?</p>
<p>Does the same logic apply to SegWit (P2WSH) multisigs?</p>

<bitcoin-core><api><multi-signature><public-key><p2sh>
Is the `addmultisignature` API call dependent on order of public keys in the array? Or is it lexicographically sorted?
Expectator
# Is the `addmultisignature` API call dependent on order of public keys in the array? Or is it lexicographically sorted?

(Asked by: username_0 on 2020-09-26)

Say Alice and Bob are part of a partnership business that accepts Bitcoin. They store all their main funds in cold storage until the end of 3 months, when they cash out and use a new address. This cold storage is in a single address.

Both Alice and Bob have full nodes, running Bitcoin Core. They use the console feature to generate a 2-of-2 P2SH multisig address, using `addmultisignature`.

They exchange each other's public keys, and input them as arguments.

If Alice used the following syntax:

`addmultisignature 2 '[,]'`

and Bob used:

`addmultisignature 2 '[,]'`

Will they end up with the script hash and address?

*Follow up questions:*

Can you give certain keys more "weighting" by specifying them more than once?

Does the same logic apply to SegWit (P2WSH) multisigs?

**Tags:** bitcoin-core, api, multi-signature, public-key, p2sh


---

## 0 answers

