<p>I know of four standard scripts.  As Luca said, the source code for the reference client is the protocol definition, so you need to read the code to get the definitive answer.  As Peter noted, a standard script is one that is relayed by the reference client.  A non-standard script will not be rejected if it is in a block as long as it is a valid script.</p>

<p>The ones that I know are:</p>

<ol>
<li>Pay-to-PubKey-Hash: This is the standard payment to a bitcoin address.  The address is in the output and the signature and pubkey are in the input.</li>
<li>Pay-to-Pubkey: This is a payment to a pubkey.  The pubkey is in the output and the signature is in the input.</li>
<li>Pay-to-ScriptHash: This is being used for some of the fancier payment transactions.  A script hash is in the output and the signature and a serialized script are in the input.  On the first pass, the script hash is verified against the serialized script.  If it checks, then the serialized script is expanded and a second pass is done using that script.</li>
<li>Pay-to-MultiSig: Multiple signatures are required to sign the script.  The output contains the pubkeys and the input contains the signatures.  All signatures must be verified by one of the pubkeys but there can be more pubkeys than signatures.  The current limit for M of N scripts is N=3.</li>
</ol>

CC BY-SA 3.0
2014-01-26T10:51:49.650Z
You may want to add that for multisig transactions, the limit is M-out-of-N, with N at most 3. Also, for P2SH there is a requirement that the embedded script is also standard. Apart from that, this list is correct for 0.8.x.
Pieter Wuille
CC BY-SA 3.0
2014-01-26T10:57:16.313Z
Also note that standardness only impacts which transactions are relayed. Non-standard scripts that are valid can be put in blocks without problems, if a miner chooses to.
Pieter Wuille
CC BY-SA 3.0
2014-01-27T08:55:43.097Z
So currently P2SH means a transaction spending it will only be relayed if that script is again one of these four?
Tobias Kienzler
CC BY-SA 3.0
2014-01-27T12:53:54.463Z
@TobiasKienzler That is my understanding.
ScripterRon
CC BY-SA 3.0
2014-07-17T21:03:20.830Z
As for M of N - the only limit for N per se is 15, but above a certain M+N your transaction size would be too big to be mined. We managed to push 3 of 3, and 2 of 4 through default pools when testing Orisi.org. And you can push 8 of 15 through the Eligius pool - they have only 5% of hashing power, so you'll have to wait 4-10 hours for the tx to go through. (also, see https://bitcoin.stackexchange.com/questions/23893/what-are-the-limits-of-m-and-n-in-m-of-n-multisig-addresses/28104#28104 )
kolinko
CC BY-SA 3.0
2014-07-17T21:06:42.580Z
Also, there is a pull request that was made by one of the core devs to relax the rules on scripts. In a few months anything will be allowed (see https://bitcoin.stackexchange.com/questions/28181/what-new-transactions-are-possible-with-15-operations ). And even before that time - Eligius will accept almost anything :)
kolinko
CC BY-SA 3.0
2014-01-25T14:31:45.983Z
2014-01-26T15:28:14.013Z
2014-01-26T15:28:14.013Z
ScripterRon
<p>The standard list of operations for scripts are actually within the <code>bitcoind</code> source-code which you can find here: <a href="https://github.com/bitcoin/bitcoin/blob/master/src/script.cpp#L90" rel="nofollow">https://github.com/bitcoin/bitcoin/blob/master/src/script.cpp#L90</a></p>

<p>To understand which ones are actually implemented and used, you'd have to read the source-code. </p>

<p>So no, there's no standard for this. The standard is the actual bitcoind program.</p>

CC BY-SA 3.0
2014-01-25T11:21:12.000Z
So a script is _always_ considered standard if it only uses these opcodes?
Tobias Kienzler
CC BY-SA 3.0
2014-01-25T13:21:27.730Z
No, these are just the list of opcodes that *exist*. Not all of them are even enabled. But it has nothing to do with standardness, that is done elsewhere in the code.
Pieter Wuille
CC BY-SA 3.0
2014-01-25T15:20:07.940Z
That's why I said "To understand which ones are actually implemented and used, you'd have to read the source-code."
Luca Matteis
CC BY-SA 3.0
2014-01-26T10:55:48.307Z
A script being "standard" is a technical term here. Standard scripts are the ones which the reference client relays. It's independent from whether they are valid or not.
Pieter Wuille
CC BY-SA 3.0
2014-01-25T11:14:58.520Z
2014-01-25T11:44:07.300Z
2014-01-25T11:44:07.300Z
Luca Matteis
<p>All I've learned about <a href="/questions/tagged/script" class="post-tag" title="show questions tagged &#39;script&#39;" rel="tag">script</a> so far is that while theoretically quite versatile (e.g. allowing multisignature transactions) most scripts are simply not propagated by the default client nodes, i.e. while you can easily transfer funds to a script, you may end up having a difficult time of ever spending these transactions. So, what makes a script standard/non-standard, is there a list of scripts currently supported by the network?</p>

CC BY-SA 3.0
2014-01-25T11:08:03.827Z
Quite the opposite: [Is there a listing of strange or unusual scripts found in transactions?](https://bitcoin.stackexchange.com/questions/5883/is-there-a-listing-of-strange-or-unusual-scripts-found-in-transactions?rq=1)
Tobias Kienzler
<bitcoin-core><script>
Which scripts are currently considered standard and therefore actually propagated?
Tobias Kienzler
# Which scripts are currently considered standard and therefore actually propagated?

(Asked by: username_0 on 2014-01-25)

All I've learned about [script](/questions/tagged/script "show questions tagged 'script'") so far is that while theoretically quite versatile (e.g. allowing multisignature transactions) most scripts are simply not propagated by the default client nodes, i.e. while you can easily transfer funds to a script, you may end up having a difficult time of ever spending these transactions. So, what makes a script standard/non-standard, is there a list of scripts currently supported by the network?

**Tags:** bitcoin-core, script

> **Comments:**
> **username_0**: Quite the opposite: [Is there a listing of strange or unusual scripts found in transactions?](https://bitcoin.stackexchange.com/questions/5883/is-there-a-listing-of-strange-or-unusual-scripts-found-in-transactions?rq=1)  

---

## 2 answers

### Answer by username_1 on 2014-01-25. Score: 3

I know of four standard scripts. As username_4 said, the source code for the reference client is the protocol definition, so you need to read the code to get the definitive answer. As Peter noted, a standard script is one that is relayed by the reference client. A non-standard script will not be rejected if it is in a block as long as it is a valid script.

The ones that I know are:

1. Pay-to-PubKey-Hash: This is the standard payment to a bitcoin address. The address is in the output and the signature and pubkey are in the input.
2. Pay-to-Pubkey: This is a payment to a pubkey. The pubkey is in the output and the signature is in the input.
3. Pay-to-ScriptHash: This is being used for some of the fancier payment transactions. A script hash is in the output and the signature and a serialized script are in the input. On the first pass, the script hash is verified against the serialized script. If it checks, then the serialized script is expanded and a second pass is done using that script.
4. Pay-to-MultiSig: Multiple signatures are required to sign the script. The output contains the pubkeys and the input contains the signatures. All signatures must be verified by one of the pubkeys but there can be more pubkeys than signatures. The current limit for M of N scripts is N=3.

> **Comments:**
> **username_2**: You may want to add that for multisig transactions, the limit is M-out-of-N, with N at most 3. Also, for P2SH there is a requirement that the embedded script is also standard. Apart from that, this list is correct for 0.8.x.  
> **username_2**: Also note that standardness only impacts which transactions are relayed. Non-standard scripts that are valid can be put in blocks without problems, if a miner chooses to.  
> **username_0**: So currently P2SH means a transaction spending it will only be relayed if that script is again one of these four?  
> **username_1**: @username_0 That is my understanding.  
> **username_3**: As for M of N - the only limit for N per se is 15, but above a certain M+N your transaction size would be too big to be mined. We managed to push 3 of 3, and 2 of 4 through default pools when testing Orisi.org. And you can push 8 of 15 through the Eligius pool - they have only 5% of hashing power, so you'll have to wait 4-10 hours for the tx to go through. (also, see https://bitcoin.stackexchange.com/questions/23893/what-are-the-limits-of-m-and-n-in-m-of-n-multisig-addresses/28104#28104 )  
> **username_3**: Also, there is a pull request that was made by one of the core devs to relax the rules on scripts. In a few months anything will be allowed (see https://bitcoin.stackexchange.com/questions/28181/what-new-transactions-are-possible-with-15-operations ). And even before that time - Eligius will accept almost anything :)  

---

### Answer by username_4 on 2014-01-25. Score: -1

The standard list of operations for scripts are actually within the `bitcoind` source-code which you can find here: <https://github.com/bitcoin/bitcoin/blob/master/src/script.cpp#L90>

To understand which ones are actually implemented and used, you'd have to read the source-code.

So no, there's no standard for this. The standard is the actual bitcoind program.

> **Comments:**
> **username_0**: So a script is _always_ considered standard if it only uses these opcodes?  
> **username_2**: No, these are just the list of opcodes that *exist*. Not all of them are even enabled. But it has nothing to do with standardness, that is done elsewhere in the code.  
> **username_4**: That's why I said "To understand which ones are actually implemented and used, you'd have to read the source-code."  
> **username_2**: A script being "standard" is a technical term here. Standard scripts are the ones which the reference client relays. It's independent from whether they are valid or not.  

---

