<p>Early on in bitcoin history, there was a proposal that scripting be replaced by a single transaction type field. This never came to pass, because it has three important problems:</p>

<ol>
<li>If you want to use a new transaction type, old clients will not have any idea of how to validate it.</li>
<li>Everyone needs to agree on new transaction types. If I say 0x03 ought to be used for multisigature transactions, and you say it ought to be used for longer hashes of public keys, then that's a problem.</li>
<li>Let's say that RIPEMD-160 becomes unsuitable for bitcoin addresses for whatever reason. In that case, we can make a new type of address, which only new clients will be able to spend to. However, there is no need to change any of the miners, because they will still understand the new scripts.</li>
</ol>

CC BY-SA 3.0
2013-02-14T22:13:21.423Z
2013-02-14T22:13:21.423Z
Nick ODell
<blockquote>
  <p><em>New scripts could be added over time.</em></p>
</blockquote>

<p>And how would you do that (without breaking old clients / getting all bitcoin clients to work the same way with the same scripts / etc) ?</p>

<p>I think the script language will let bitcoin evolve, without having to make any (fundamental) changes to the protocol. It's a futurewise smart decision (just like bitcoin has some protection against quantum computers, even though they ain't "dangerous" yet - and might never be). IMO it's one of the thing that make bitcoin 'better than the rest'.</p>

<p>Ofc having a less complex script language would minimize any potential attack vector, but I think the complexity of the language already is low enough for it not to be of any concern. At most we will probably see DoS attack (e.g. transactions which loops endless), but this should be easily fixable with an update (and the currently client already have lots of "anti-DoS" checks, to protect against this).</p>

CC BY-SA 3.0
2013-02-14T18:45:53.147Z
Bitcoin scripts lack any sort of looping operation. For instance, instead of using loops to do hashing, bitcoin uses a dedicated operation, OP_SHA256 to do it.
Nick ODell
CC BY-SA 3.0
2013-02-14T16:04:25.300Z
2013-02-14T16:04:25.300Z
Nicolai
<p>Why does Bitcoin have a complicated scripting system?
<a href="https://en.bitcoin.it/wiki/Script" rel="nofollow">https://en.bitcoin.it/wiki/Script</a>
<a href="https://github.com/bitcoin/bitcoin/blob/master/src/script.cpp" rel="nofollow">https://github.com/bitcoin/bitcoin/blob/master/src/script.cpp</a></p>

<p>I guess because it makes fancy contracts possible: <a href="https://en.bitcoin.it/wiki/Contracts" rel="nofollow">https://en.bitcoin.it/wiki/Contracts</a> Could even be kinds of contracts that we would never think about today.</p>

<p>Still, from what I understand currently there are only a handful of scripts in popular use.</p>

<p>Would it not be wise to restrict the scripting engine to a limited number of well understood scripts? It seems like an invitation for trouble. New scripts could be added over time.</p>

CC BY-SA 3.0
2013-02-14T14:46:10.643Z
I am aware that some OPs are already disabled: http://bitcoin.stackexchange.com/questions/5884/are-all-the-coin-networks-consistent-in-which-script-actions-are-permitted-and/7472#7472   Still there seems to be a allowed a lot.
kermit
<security><script>
Is the scripting system an incalculable security risk?
kermit
# Is the scripting system an incalculable security risk?

(Asked by: username_0 on 2013-02-14)

Why does Bitcoin have a complicated scripting system?
<https://en.bitcoin.it/wiki/Script>
<https://github.com/bitcoin/bitcoin/blob/master/src/script.cpp>

I guess because it makes fancy contracts possible: <https://en.bitcoin.it/wiki/Contracts> Could even be kinds of contracts that we would never think about today.

Still, from what I understand currently there are only a handful of scripts in popular use.

Would it not be wise to restrict the scripting engine to a limited number of well understood scripts? It seems like an invitation for trouble. New scripts could be added over time.

**Tags:** security, script

> **Comments:**
> **username_0**: I am aware that some OPs are already disabled: http://bitcoin.stackexchange.com/questions/5884/are-all-the-coin-networks-consistent-in-which-script-actions-are-permitted-and/7472#7472   Still there seems to be a allowed a lot.  

---

## 2 answers

### Answer by username_2 on 2013-02-14. Score: 5 | Accepted answer

> *New scripts could be added over time.*

And how would you do that (without breaking old clients / getting all bitcoin clients to work the same way with the same scripts / etc) ?

I think the script language will let bitcoin evolve, without having to make any (fundamental) changes to the protocol. It's a futurewise smart decision (just like bitcoin has some protection against quantum computers, even though they ain't "dangerous" yet - and might never be). IMO it's one of the thing that make bitcoin 'better than the rest'.

Ofc having a less complex script language would minimize any potential attack vector, but I think the complexity of the language already is low enough for it not to be of any concern. At most we will probably see DoS attack (e.g. transactions which loops endless), but this should be easily fixable with an update (and the currently client already have lots of "anti-DoS" checks, to protect against this).

> **Comments:**
> **username_1**: Bitcoin scripts lack any sort of looping operation. For instance, instead of using loops to do hashing, bitcoin uses a dedicated operation, OP_SHA256 to do it.  

---

### Answer by username_1 on 2013-02-14. Score: 2

Early on in bitcoin history, there was a proposal that scripting be replaced by a single transaction type field. This never came to pass, because it has three important problems:

1. If you want to use a new transaction type, old clients will not have any idea of how to validate it.
2. Everyone needs to agree on new transaction types. If I say 0x03 ought to be used for multisigature transactions, and you say it ought to be used for longer hashes of public keys, then that's a problem.
3. Let's say that RIPEMD-160 becomes unsuitable for bitcoin addresses for whatever reason. In that case, we can make a new type of address, which only new clients will be able to spend to. However, there is no need to change any of the miners, because they will still understand the new scripts.


---

