<p>I think the reason you might be getting confused is that there are really two types of multisig, raw multisig and P2SH (pay-to-script-hash) multisig. P2SH multisig is basically just hashing the actual scriptPubKey desired and putting the scriptPubKey in the scriptSig. This stack exchange questions explains them in more detail: <a href="https://bitcoin.stackexchange.com/questions/23893/what-are-the-limits-of-m-and-n-in-m-of-n-multisig-addresses/28092#28092">What are the limits of m and n in m-of-n multisig addresses?</a>. </p>

<blockquote>
  <p>I'm also trying to understand if a 3 of 3 transaction is supported as well.</p>
</blockquote>

<p>Yes, you can do m-of-3 multisig transactions with both raw multisig and P2SH multisig.</p>

<blockquote>
  <p>the meaning of the parameters "2" in addmultisigaddress</p>
</blockquote>

<p>The number provided is the m in the m-of-n. So if you want a 1-of-2, you do:</p>

<pre><code>addmultisigaddress 1 '["1xy..", "1Jm..."]' 
</code></pre>

<p>The BIP11 (accepted) proposal you mentioned just made raw multisig a standard type of transaction that is recognized and forwarded on by standard clients. BIP16 (<a href="https://github.com/bitcoin/bips/blob/master/bip-0016.mediawiki" rel="nofollow noreferrer">https://github.com/bitcoin/bips/blob/master/bip-0016.mediawiki</a>) proposes the P2SH addresses, which allow for much shorter <code>scriptPubKey</code>s and support more types of multisig (e.g. 5-of-9, which you can't easily do with raw multisig because m-of-n multisigs with n > 3 are considered non-standard, as shown in the link in the first paragraph). </p>

CC BY-SA 3.0
2014-12-15T11:09:11.903Z
You have *m* and *n* mixed up.  [BIP11](https://github.com/bitcoin/bips/blob/master/bip-0011.mediawiki) uses m-of-n, where *m* is the *minimum* number of signatures and *n* is the *number* of keys.  (Or at least that's how I remember it.)
David A. Harding
CC BY-SA 3.0
2014-12-15T14:24:04.900Z
@DavidA.Harding, I update the post to use the standard notation.
morsecoder
CC BY-SA 3.0
2015-01-14T15:57:12.683Z
@NickODell, which part do you think needs a clarification? I linked to [this](http://bitcoin.stackexchange.com/questions/23893/what-are-the-limits-of-m-and-n-in-m-of-n-multisig-addresses/28092#28092), which explains the size limits.
morsecoder
CC BY-SA 3.0
2015-01-14T16:06:49.060Z
@StephenM347 `(e.g. 5-of-9, which you can't do with raw multisig because it would make the scriptPubKey too large).` I think that everything up to and including 20-of-20 multisig is valid. For example: https://blockchain.info/tx-index/49797406/0
Nick ODell
CC BY-SA 3.0
2015-01-14T16:16:27.243Z
@NickODell Gotcha, I'll clarify that it's an issue of standardness rather than validity.
morsecoder
CC BY-SA 3.0
2014-12-15T00:09:29.980Z
2015-01-14T16:18:06.110Z
2017-04-13T12:47:33.610Z
morsecoder
<p>I'm trying to write a BIP11-compliant C# client that creates a 2 of 2 or 2 of 3 transaction.</p>

<p>I'm also trying to understand if a 3 of 3 transaction is supported as well.</p>

<p><a href="https://people.xiph.org/~greg/escrowexample.txt" rel="nofollow">This example says they are creating a PS2H address</a>, but I'm unsure of exactly what script is being signed, and the meaning of the parameters "2" in addmultisigaddress, and what happens when addmultisigaddress is called.</p>

<p>I have researched the BIP, the <a href="https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list" rel="nofollow">RPC documentation</a>, and the forums.  I'm getting confused where if and when the P2SH is needed.</p>

<multi-signature><p2sh>
How exactly does BIP11 work, and how can it be used, particularly with/without P2SH?
makerofthings7
# How exactly does BIP11 work, and how can it be used, particularly with/without P2SH?

(Asked by: username_0 on 2013-10-25)

I'm trying to write a BIP11-compliant C# client that creates a 2 of 2 or 2 of 3 transaction.

I'm also trying to understand if a 3 of 3 transaction is supported as well.

[This example says they are creating a PS2H address](https://people.xiph.org/~greg/escrowexample.txt), but I'm unsure of exactly what script is being signed, and the meaning of the parameters "2" in addmultisigaddress, and what happens when addmultisigaddress is called.

I have researched the BIP, the [RPC documentation](https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list), and the forums. I'm getting confused where if and when the P2SH is needed.

**Tags:** multi-signature, p2sh


---

## 1 answers

### Answer by username_1 on 2014-12-15. Score: 2

I think the reason you might be getting confused is that there are really two types of multisig, raw multisig and P2SH (pay-to-script-hash) multisig. P2SH multisig is basically just hashing the actual scriptPubKey desired and putting the scriptPubKey in the scriptSig. This stack exchange questions explains them in more detail: [What are the limits of m and n in m-of-n multisig addresses?](https://bitcoin.stackexchange.com/questions/23893/what-are-the-limits-of-m-and-n-in-m-of-n-multisig-addresses/28092#28092).

> I'm also trying to understand if a 3 of 3 transaction is supported as well.

Yes, you can do m-of-3 multisig transactions with both raw multisig and P2SH multisig.

> the meaning of the parameters "2" in addmultisigaddress

The number provided is the m in the m-of-n. So if you want a 1-of-2, you do:

```
addmultisigaddress 1 '["1xy..", "1Jm..."]' 

```

The BIP11 (accepted) proposal you mentioned just made raw multisig a standard type of transaction that is recognized and forwarded on by standard clients. BIP16 (<https://github.com/bitcoin/bips/blob/master/bip-0016.mediawiki>) proposes the P2SH addresses, which allow for much shorter `scriptPubKey`s and support more types of multisig (e.g. 5-of-9, which you can't easily do with raw multisig because m-of-n multisigs with n > 3 are considered non-standard, as shown in the link in the first paragraph).

> **Comments:**
> **username_2**: You have *m* and *n* mixed up.  [BIP11](https://github.com/bitcoin/bips/blob/master/bip-0011.mediawiki) uses m-of-n, where *m* is the *minimum* number of signatures and *n* is the *number* of keys.  (Or at least that's how I remember it.)  
> **username_1**: @username_2, I update the post to use the standard notation.  
> **username_1**: @username_3, which part do you think needs a clarification? I linked to [this](http://bitcoin.stackexchange.com/questions/23893/what-are-the-limits-of-m-and-n-in-m-of-n-multisig-addresses/28092#28092), which explains the size limits.  
> **username_3**: @StephenM347 `(e.g. 5-of-9, which you can't do with raw multisig because it would make the scriptPubKey too large).` I think that everything up to and including 20-of-20 multisig is valid. For example: https://blockchain.info/tx-index/49797406/0  
> **username_1**: @username_3 Gotcha, I'll clarify that it's an issue of standardness rather than validity.  

---

