<p>This should be possible by having several checks happen in one script.</p>

<p>So, a normal pay-to-address script looks like:</p>

<pre><code>OP_DUP OP_HASH160 &lt;pubKeyHash&gt; OP_EQUALVERIFY OP_CHECKSIG
</code></pre>

<p>And a normal multisig, say for 2-of-3, looks like this (format is a little different from above):</p>

<pre><code>format: [byte value] [meaning]
52 OP_2, meaning you need two signatures
41 push 65 bytes
[pubkey 1]
41 push 65 bytes
[pubkey 2]
41 push 65 bytes
[pubkey 3]
53 OP_3, meaning there are three public keys
ae OP_CHECKMULTISIG described at https://en.bitcoin.it/wiki/Script
</code></pre>

<p>And we want to have three checks: A must have signed, 1-of-(B and C) must have signed, and 2-of-(D, E, F, G) must have signed. So we chain it like so:</p>

<pre><code>OP_DUP OP_HASH160 &lt;pubKeyHash A&gt; OP_EQUALVERIFY OP_CHECKSIGVERIFY
OP_1 &lt;pubkey B&gt; &lt;pubkey C&gt; OP_2 OP_CHECKMULTISIGVERIFY
OP_2 &lt;pubkey D&gt; &lt;pubkey E&gt; &lt;pubkey F&gt; &lt;pubkey G&gt; OP_4 OP_CHECKMULTISIG
</code></pre>

<p>And hash that script to have something easy to send to (<a href="https://en.bitcoin.it/wiki/Transactions#Pay-to-Script-Hash" rel="nofollow">pay-to-script-hash</a>). Note the use of the VERIFY variants in the first two checks and the ordinary one in the last. If you look at the meaning of <a href="https://en.bitcoin.it/wiki/Script" rel="nofollow">these OP codes</a> and the fact that a valid transaction needs to end with a non-zero value, the correctness of this should be clear.</p>

<p>It'd be a good idea to try this out on the <a href="https://en.bitcoin.it/wiki/Testnet" rel="nofollow">testnet</a> before using it in a real transaction, so that you don't wind up with unspendable (or spendable-by-anyone) bitcoins.</p>

CC BY-SA 3.0
2014-06-12T18:58:01.877Z
2014-06-12T19:06:23.837Z
2014-06-12T19:06:23.837Z
Tim S.
<p>Let's say that 7 users want to spend money from a Bitcoin multisig address. The approval of funds from this address requires the signatures of A (the leader), either B or C (two managers), and 2 of 4 members of a board of investors (D, E, F, G). So if A, B, D, &amp; G all submit their signatures then the transaction should be considered valid. However, even if B, C, D, E, F, and G all submit their signatures, A can veto by not submitting his/her signature.</p>

<p>Does the Bitcoin protocol currently support advanced transactions like this or does it only support basic M-of-N addresses/transactions?</p>

<transactions><address>
Advanced Bitcoin Transactions
morsecoder
# Advanced Bitcoin Transactions

(Asked by: username_0 on 2014-06-12)

Let's say that 7 users want to spend money from a Bitcoin multisig address. The approval of funds from this address requires the signatures of A (the leader), either B or C (two managers), and 2 of 4 members of a board of investors (D, E, F, G). So if A, B, D, & G all submit their signatures then the transaction should be considered valid. However, even if B, C, D, E, F, and G all submit their signatures, A can veto by not submitting his/her signature.

Does the Bitcoin protocol currently support advanced transactions like this or does it only support basic M-of-N addresses/transactions?

**Tags:** transactions, address


---

## 1 answers

### Answer by username_1 on 2014-06-12. Score: 2 | Accepted answer

This should be possible by having several checks happen in one script.

So, a normal pay-to-address script looks like:

```
OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG

```

And a normal multisig, say for 2-of-3, looks like this (format is a little different from above):

```
format: [byte value] [meaning]
52 OP_2, meaning you need two signatures
41 push 65 bytes
[pubkey 1]
41 push 65 bytes
[pubkey 2]
41 push 65 bytes
[pubkey 3]
53 OP_3, meaning there are three public keys
ae OP_CHECKMULTISIG described at https://en.bitcoin.it/wiki/Script

```

And we want to have three checks: A must have signed, 1-of-(B and C) must have signed, and 2-of-(D, E, F, G) must have signed. So we chain it like so:

```
OP_DUP OP_HASH160 <pubKeyHash A> OP_EQUALVERIFY OP_CHECKSIGVERIFY
OP_1 <pubkey B> <pubkey C> OP_2 OP_CHECKMULTISIGVERIFY
OP_2 <pubkey D> <pubkey E> <pubkey F> <pubkey G> OP_4 OP_CHECKMULTISIG

```

And hash that script to have something easy to send to ([pay-to-script-hash](https://en.bitcoin.it/wiki/Transactions#Pay-to-Script-Hash)). Note the use of the VERIFY variants in the first two checks and the ordinary one in the last. If you look at the meaning of [these OP codes](https://en.bitcoin.it/wiki/Script) and the fact that a valid transaction needs to end with a non-zero value, the correctness of this should be clear.

It'd be a good idea to try this out on the [testnet](https://en.bitcoin.it/wiki/Testnet) before using it in a real transaction, so that you don't wind up with unspendable (or spendable-by-anyone) bitcoins.


---

