<p>Transaction from a <code>Multisig Bitcoin address</code> (starting with 3) requires signature from N of M </p>

<ul>
<li>M represents number of parties allowed to unlock UTXO (input of transaction). In case of 2-2, both signature from both parties have to be involved to create valid transaction</li>
<li>N is number of owners (known as <code>threshold</code>) whose digital signature is required to sign a valid transaction</li>
</ul>

<p>However, <code>Multi input transaction</code> is a type of transaction where input involves UTXO from 1 or more either standard or multisig bitcoin addresses.</p>

<p>Following states may occur</p>

<ol>
<li><p>Standard Bitcoin address signs transaction with 1 input</p>

<ul>
<li>requires one digital signature with valid private key</li>
</ul></li>
<li><p>Standard Bitcoin address signs transaction with more than 1 input (multi-input transaction)</p>

<ul>
<li>requires digital signature for each UTXO with valid private key</li>
</ul></li>
<li><p>Multisig Bitcoin address signs transaction with 1 input</p>

<ul>
<li>requires one digital signature from threshold</li>
</ul></li>
<li><p>Multisig Bitcoin address signs transaction with more than 1 input (multi-input transaction)</p>

<ul>
<li>requires digital signature for each UTXO by threshold</li>
</ul></li>
</ol>

<p><em>Up to this point, <code>ALL UTXO</code> belong to signer of transaction. Now transactions will contain UTXO for more than 1 Bitcoin address.</em></p>

<ol start="5">
<li><p>Two Standard Bitcoin addreses sign a transaction with 1 UTXO for each of them (multi-input transaction)</p>

<ul>
<li>requires digital signature for each UTXO by corresponding valid private key</li>
</ul></li>
</ol>

<p>Ex. Transaction involves 2 UTXO for 2 separate Standard Bitcoin addresses, to create valid transaction, address A have to sign UTXO(A) and address B sign UTXO(B). Transaction can now have 1 output making the cost of fees much lower than in scenario, where for each Bitcoin address is created separate transaction. </p>

<ol start="6">
<li><p>Two Multisig Bitcoin addreses sign a transaction with 1 UTXO for each of them (multi-input transaction)</p>

<ul>
<li>requires digital signature for each UTXO by corresponding valid private key of threshold</li>
</ul></li>
</ol>

<p>Ex. Transaction involves 2 UTXO for 2 separate Multisig Bitcoin addresses, to create valid transaction, threshold of address A have to sign UTXO(A) and threshold of address B sign UTXO(B).</p>

<ol start="7">
<li>Option 5 and 6 combined.</li>
</ol>

<p>Ex. Transaction is composed from UTXO for 1 or more Standard Bitcoin address and 1 or more Multisig Bitcoin address.</p>

CC BY-SA 3.0
2015-02-03T22:36:26.273Z
2015-02-04T23:14:34.817Z
2015-02-04T23:14:34.817Z
Marek
<p>They are fairly different things and represent very different use cases. </p>

<p>Imagine you are the head of the party planning committee and you have two workers (A and B) to help you buy items for the party. You are given 1 bitcoin to fund the party. </p>

<p>You have two options. </p>

<ul>
<li>You can split the funds up between A and B. For example, you could give A and B each 0.5 bitcoins in two separate outputs. If they need to buy something worth more than 0.5 bitcoins, they will need to combine their outputs as inputs to the same transaction. However, for items less than 0.5 bitcoins, A and B will be able to act independently to purchase items (or steal the funds!).</li>
<li>You can jointly give A and B the 1 bitcoin in a 2 of 2 multisig address. Now for any purchase they will need to agree in order to spend from the party committee's funds.</li>
</ul>

<p>To summarize:</p>

<p><strong>Spending a 2/2 multisig output:</strong></p>

<p>Spends a single previously UTXO and requiring two keys to sign. </p>

<p><strong>Spending multiple inputs:</strong></p>

<p>Spends multiple previously UTXOs and requires each input to be signed separately. </p>

<hr/>

<p>With regards to signing these types of transactions, they have to be done slightly differently. </p>

<p>When signing an input that spends a 2/2 multisig output, the transaction is signed by the two keys and they are encoded into the same <code>scriptSig</code> of the one input. The transaction only becomes valid when both keys have signed with valid signatures.</p>

<p>For example, suppose the scriptPubKey of the previous 2/2 multisig output is:</p>

<pre><code>OP_2 {pubkey1} {pubkey2} OP_2 OP_CHECKMULTISIG
</code></pre>

<p>The the scriptSig to spend that output would be:</p>

<pre><code>{pubkey1's signature} {pubkey2's signature}
</code></pre>

<p>Notice how they are in the same input's scriptSig.</p>

<p>When signing two different inputs, assuming their previous scriptPubKeys look something like this:</p>

<pre><code>{pubkey1} OP_CHECKSIG
</code></pre>

<p>and</p>

<pre><code>{pubkey2} OP_CHECKSIG
</code></pre>

<p>Then the two inputs would have scripSigs in this format (respectively):</p>

<pre><code>{pubkey1 signature}
</code></pre>

<p>and</p>

<pre><code>{pubkey2 signature}
</code></pre>

<p>NOTE: I've used simple scriptPubKey's to be try to be clear about how it generally works, but you should probably use Pay-to-script-hash multisig address and pay-to-pubkey-hash addresses instead of the raw multisig and pay-to-pubkey scriptPubKeys that I used in this example.</p>

CC BY-SA 3.0
2015-02-03T22:16:34.507Z
This actually was not the answer I'm looking for. In implementation level, how does these two differ: 1) requires two keys to sign 2)requires each input to be signed separately . What I mean is at the end there is a unsigned raw transaction that should be signed, how the signing procedure would differ between these two scenarios?
Shayan
CC BY-SA 3.0
2015-02-03T22:32:53.330Z
@Shayanbahal, does that clear it up?
morsecoder
CC BY-SA 3.0
2015-02-04T00:58:08.193Z
That was really good, thanks. Only regarding the last part (NOTE) I'm not quite clear on what you meant by " you should probably use Pay-to-script-hash multisig address and pay-to-pubkey-hash addresses instead of the raw multisig and pay-to-pubkey scriptPubKeys that I used in this example."
Shayan
CC BY-SA 3.0
2015-02-04T04:28:12.187Z
@Shayanbahal, the answer to what all of those things are is probably outside the scope of this question. [This answer](http://bitcoin.stackexchange.com/a/28092/18196) should help explain the difference between raw multisig and P2SH multisig. [The bitcoin developer documentation](https://bitcoin.org/en/developer-guide#pay-to-public-key-hash-p2pkh) is also helpful. And make sure you mark the answers to your questions with the green check mark. :)
morsecoder
CC BY-SA 3.0
2015-02-03T21:50:09.707Z
2015-02-03T22:30:27.133Z
2015-02-03T22:30:27.133Z
morsecoder
<p>Let's say we have a 2 of 2 multisig address that we want to spend from, so the transaction should be signed by both of the private keys.</p>

<p>Now let's say we have a transaction with two inputs, so once again the transaction should be signed by both of the private keys of the inputs.</p>

<p>So how does these two differ in implementation? Even on conceptual level? Are these procedures the same?</p>

CC BY-SA 3.0
2015-02-03T21:46:56.363Z
Are the two inputs both spending from the multisig address?
Nick ODell
CC BY-SA 3.0
2015-02-03T21:47:14.113Z
Related: http://bitcoin.stackexchange.com/questions/32365/if-i-am-spending-multiple-inputs-from-the-same-address-must-i-provide-a-signatu
morsecoder
<transactions><multi-signature><signature>
Multisig vs Multi input transaction signing
Shayan
# Multisig vs Multi input transaction signing

(Asked by: username_0 on 2015-02-03)

Let's say we have a 2 of 2 multisig address that we want to spend from, so the transaction should be signed by both of the private keys.

Now let's say we have a transaction with two inputs, so once again the transaction should be signed by both of the private keys of the inputs.

So how does these two differ in implementation? Even on conceptual level? Are these procedures the same?

**Tags:** transactions, multi-signature, signature

> **Comments:**
> **username_1**: Are the two inputs both spending from the multisig address?  
> **username_2**: Related: http://bitcoin.stackexchange.com/questions/32365/if-i-am-spending-multiple-inputs-from-the-same-address-must-i-provide-a-signatu  

---

## 2 answers

### Answer by username_2 on 2015-02-03. Score: 5 | Accepted answer

They are fairly different things and represent very different use cases.

Imagine you are the head of the party planning committee and you have two workers (A and B) to help you buy items for the party. You are given 1 bitcoin to fund the party.

You have two options.

* You can split the funds up between A and B. For example, you could give A and B each 0.5 bitcoins in two separate outputs. If they need to buy something worth more than 0.5 bitcoins, they will need to combine their outputs as inputs to the same transaction. However, for items less than 0.5 bitcoins, A and B will be able to act independently to purchase items (or steal the funds!).
* You can jointly give A and B the 1 bitcoin in a 2 of 2 multisig address. Now for any purchase they will need to agree in order to spend from the party committee's funds.

To summarize:

**Spending a 2/2 multisig output:**

Spends a single previously UTXO and requiring two keys to sign.

**Spending multiple inputs:**

Spends multiple previously UTXOs and requires each input to be signed separately.

---

With regards to signing these types of transactions, they have to be done slightly differently.

When signing an input that spends a 2/2 multisig output, the transaction is signed by the two keys and they are encoded into the same `scriptSig` of the one input. The transaction only becomes valid when both keys have signed with valid signatures.

For example, suppose the scriptPubKey of the previous 2/2 multisig output is:

```
OP_2 {pubkey1} {pubkey2} OP_2 OP_CHECKMULTISIG

```

The the scriptSig to spend that output would be:

```
{pubkey1's signature} {pubkey2's signature}

```

Notice how they are in the same input's scriptSig.

When signing two different inputs, assuming their previous scriptPubKeys look something like this:

```
{pubkey1} OP_CHECKSIG

```

and

```
{pubkey2} OP_CHECKSIG

```

Then the two inputs would have scripSigs in this format (respectively):

```
{pubkey1 signature}

```

and

```
{pubkey2 signature}

```

NOTE: I've used simple scriptPubKey's to be try to be clear about how it generally works, but you should probably use Pay-to-script-hash multisig address and pay-to-pubkey-hash addresses instead of the raw multisig and pay-to-pubkey scriptPubKeys that I used in this example.

> **Comments:**
> **username_0**: This actually was not the answer I'm looking for. In implementation level, how does these two differ: 1) requires two keys to sign 2)requires each input to be signed separately . What I mean is at the end there is a unsigned raw transaction that should be signed, how the signing procedure would differ between these two scenarios?  
> **username_2**: @Shayanbahal, does that clear it up?  
> **username_0**: That was really good, thanks. Only regarding the last part (NOTE) I'm not quite clear on what you meant by " you should probably use Pay-to-script-hash multisig address and pay-to-pubkey-hash addresses instead of the raw multisig and pay-to-pubkey scriptPubKeys that I used in this example."  
> **username_2**: @Shayanbahal, the answer to what all of those things are is probably outside the scope of this question. [This answer](http://bitcoin.stackexchange.com/a/28092/18196) should help explain the difference between raw multisig and P2SH multisig. [The bitcoin developer documentation](https://bitcoin.org/en/developer-guide#pay-to-public-key-hash-p2pkh) is also helpful. And make sure you mark the answers to your questions with the green check mark. :)  

---

### Answer by username_3 on 2015-02-03. Score: 2

Transaction from a `Multisig Bitcoin address` (starting with 3) requires signature from N of M

* M represents number of parties allowed to unlock UTXO (input of transaction). In case of 2-2, both signature from both parties have to be involved to create valid transaction
* N is number of owners (known as `threshold`) whose digital signature is required to sign a valid transaction

However, `Multi input transaction` is a type of transaction where input involves UTXO from 1 or more either standard or multisig bitcoin addresses.

Following states may occur

1. Standard Bitcoin address signs transaction with 1 input

   * requires one digital signature with valid private key
2. Standard Bitcoin address signs transaction with more than 1 input (multi-input transaction)

   * requires digital signature for each UTXO with valid private key
3. Multisig Bitcoin address signs transaction with 1 input

   * requires one digital signature from threshold
4. Multisig Bitcoin address signs transaction with more than 1 input (multi-input transaction)

   * requires digital signature for each UTXO by threshold

*Up to this point, `ALL UTXO` belong to signer of transaction. Now transactions will contain UTXO for more than 1 Bitcoin address.*

5. Two Standard Bitcoin addreses sign a transaction with 1 UTXO for each of them (multi-input transaction)

   * requires digital signature for each UTXO by corresponding valid private key

Ex. Transaction involves 2 UTXO for 2 separate Standard Bitcoin addresses, to create valid transaction, address A have to sign UTXO(A) and address B sign UTXO(B). Transaction can now have 1 output making the cost of fees much lower than in scenario, where for each Bitcoin address is created separate transaction.

6. Two Multisig Bitcoin addreses sign a transaction with 1 UTXO for each of them (multi-input transaction)

   * requires digital signature for each UTXO by corresponding valid private key of threshold

Ex. Transaction involves 2 UTXO for 2 separate Multisig Bitcoin addresses, to create valid transaction, threshold of address A have to sign UTXO(A) and threshold of address B sign UTXO(B).

7. Option 5 and 6 combined.

Ex. Transaction is composed from UTXO for 1 or more Standard Bitcoin address and 1 or more Multisig Bitcoin address.


---

