<p>OK, the original concept of scripts was not perfect. But with p2sh (BIP-16) any script can be realized</p>

CC BY-SA 3.0
2015-08-26T07:10:42.573Z
This seems like a really peculiar answer. I mean, BIP16 doesn't really do anything aside from deferring including the script until the scriptSig. Sure, you could deploy almost any soft-forking change to script the same way that BIP16 was, but that could also be done if script was substantially simpler than it actually is.
Nick ODell
CC BY-SA 3.0
2015-09-08T02:11:39.390Z
@nick as far as i understand the isStandard function is also not in effect anymore with p2sh. Meaning that the script is actually NOT restricted to a few standard scripts anymore as opposed to what's posited in the original question. Agree? I think that's what amaclin is referring to.
Jannes
CC BY-SA 3.0
2016-04-08T03:36:14.733Z
@amaclin is correct, no standardness constraints apply to P2SH. How could you enforce otherwise - only the hash is known to the network when the address gets funded.
karimkorun
CC BY-SA 3.0
2015-08-26T05:56:05.540Z
2015-08-26T05:56:05.540Z
amaclin
<p>Well the reason for allowing only some script forms is to ensure that the language is not Turing complete. The simplest reason why you cant have a Turing complete language is because you want a block to be pushed up into the blockchain every 10 mins. So you have to find a way to indirectly control execution time. Certain other scripts are prevented because of feared security vulnerabilities. A Turing complete language within bitcoin would call for a solution of the kind implemented by Ethereum.</p>

<p>Your second point about why certain scripts are allowed in blocks but not in transactions is an interesting one and is mostly because some of the vulnerabilities were discovered well  after bitcoin got rolling. So invalidating the blocks that had the problematic opcodes would have required a hard fork. Whereas just blocking the problematic opcodes to prevent future issues was much easier. Now it would be interesting if redeeming the coins in some block necessitated the use of any of the blocked opcodes, but I guess there aren't any transactions of that kind.</p>

CC BY-SA 3.0
2016-02-07T08:22:40.577Z
2016-02-07T08:22:40.577Z
user2277550
<p>The bitcoin script mechanism is very simple and dumb, that's the reason why it is so secure. the more it will be complex the less it can be secured cause more scenarios can occur and points of failures. so you have a very simple mechanism with limited operations, very easy to test and maintain securely, still extendable such as pay to script hash.</p>

CC BY-SA 3.0
2015-09-08T19:25:22.950Z
2015-09-08T19:25:22.950Z
Haddar Macdasi
<p>Bitcoin was the first crypto coin. Satoshi when analyzing the problem of digital payment discovered that the machine needs to determine if some transaction sucessfully or unsuccessfully spent the output. In the most trivial case this means the signature is ok and pubkey matches.</p>

<p>Determining if anything (the spend) is one of two possible values (1=success, 0=failure) is the most studied problem in computer engineering, also known as set membership or recognition of word from language.</p>

<p>Standard off-the shelf solution to this problem is to use some machine that meets the criteria. For bitcoin the requirement that the machine should always halt, as fast as possible. the strongest machine with this guarantee is some kind of a stack machine. </p>

<p>TL;DR Satoshi just used the obvious solution to a known subject</p>

CC BY-SA 3.0
2016-02-06T19:48:11.233Z
2016-02-06T20:05:07.823Z
2016-02-06T20:05:07.823Z
Anlhord Smithson
<p>What is the purpose of a stackmachine if only some standard script forms are allowed? And why are some scripts allowed and perfectly fine in mined blocks but rejected by clients if found in transactions; what's the point of that? The more I read about script the less it makes sense.</p>

CC BY-SA 3.0
2015-08-28T18:25:45.403Z
I'm offering an opinion, however I opine that because of the possibilities of the Blockchain, it'd be silly of satoshi not to implement the framework so it can be integrated later much easier. Very similar to object orientated programming where the concepts are in place, but are essentially standing in
Wizard Of Ozzie
CC BY-SA 3.0
2015-09-16T23:30:24.887Z
The question is not entirely true. The official client will only *relay* scripts in a handful of standard forms, but it will *accept* a broader range of scripts in a block mined by a more capable client.
Nayuki
<script>
What's the point of having a stack-based scripting language, if only a few standard forms are allowed?
wischi
# What's the point of having a stack-based scripting language, if only a few standard forms are allowed?

(Asked by: username_0 on 2015-08-26)

What is the purpose of a stackmachine if only some standard script forms are allowed? And why are some scripts allowed and perfectly fine in mined blocks but rejected by clients if found in transactions; what's the point of that? The more I read about script the less it makes sense.

**Tags:** script

> **Comments:**
> **username_1**: I'm offering an opinion, however I opine that because of the possibilities of the Blockchain, it'd be silly of satoshi not to implement the framework so it can be integrated later much easier. Very similar to object orientated programming where the concepts are in place, but are essentially standing in  
> **username_2**: The question is not entirely true. The official client will only *relay* scripts in a handful of standard forms, but it will *accept* a broader range of scripts in a block mined by a more capable client.  

---

## 4 answers

### Answer by username_3 on 2015-08-26. Score: 1

OK, the original concept of scripts was not perfect. But with p2sh (BIP-16) any script can be realized

> **Comments:**
> **username_4**: This seems like a really peculiar answer. I mean, BIP16 doesn't really do anything aside from deferring including the script until the scriptSig. Sure, you could deploy almost any soft-forking change to script the same way that BIP16 was, but that could also be done if script was substantially simpler than it actually is.  
> **username_5**: @username_4 as far as i understand the isStandard function is also not in effect anymore with p2sh. Meaning that the script is actually NOT restricted to a few standard scripts anymore as opposed to what's posited in the original question. Agree? I think that's what username_3 is referring to.  
> **username_6**: @username_3 is correct, no standardness constraints apply to P2SH. How could you enforce otherwise - only the hash is known to the network when the address gets funded.  

---

### Answer by username_7 on 2016-02-07. Score: 0

Well the reason for allowing only some script forms is to ensure that the language is not Turing complete. The simplest reason why you cant have a Turing complete language is because you want a block to be pushed up into the blockchain every 10 mins. So you have to find a way to indirectly control execution time. Certain other scripts are prevented because of feared security vulnerabilities. A Turing complete language within bitcoin would call for a solution of the kind implemented by Ethereum.

Your second point about why certain scripts are allowed in blocks but not in transactions is an interesting one and is mostly because some of the vulnerabilities were discovered well after bitcoin got rolling. So invalidating the blocks that had the problematic opcodes would have required a hard fork. Whereas just blocking the problematic opcodes to prevent future issues was much easier. Now it would be interesting if redeeming the coins in some block necessitated the use of any of the blocked opcodes, but I guess there aren't any transactions of that kind.


---

### Answer by username_8 on 2015-09-08. Score: 0

The bitcoin script mechanism is very simple and dumb, that's the reason why it is so secure. the more it will be complex the less it can be secured cause more scenarios can occur and points of failures. so you have a very simple mechanism with limited operations, very easy to test and maintain securely, still extendable such as pay to script hash.


---

### Answer by username_9 on 2016-02-06. Score: 0

Bitcoin was the first crypto coin. Satoshi when analyzing the problem of digital payment discovered that the machine needs to determine if some transaction sucessfully or unsuccessfully spent the output. In the most trivial case this means the signature is ok and pubkey matches.

Determining if anything (the spend) is one of two possible values (1=success, 0=failure) is the most studied problem in computer engineering, also known as set membership or recognition of word from language.

Standard off-the shelf solution to this problem is to use some machine that meets the criteria. For bitcoin the requirement that the machine should always halt, as fast as possible. the strongest machine with this guarantee is some kind of a stack machine.

TL;DR Satoshi just used the obvious solution to a known subject


---

