<p>Bitcoin Cash is a code and blockhain fork (blocks 0 to 478558 are the same on both blockchains) which did the following upgrades to Bitcoin Script VM:</p>
<ul>
<li><strong>2017</strong> Malleability fixes
<ul>
<li><a href="https://documentation.cash/protocol/forks/bch-uahf#req-6-4-mandatory-use-of-script_verify_strictenc" rel="nofollow noreferrer">Mandatory use of SCRIPT_VERIFY_STRICTENC</a></li>
<li><a href="https://documentation.cash/protocol/forks/hf-20171113#summary" rel="nofollow noreferrer">Enforcement of LOW_S signatures and NULLFAIL (BIP-0146)</a></li>
</ul>
</li>
<li><strong>2018</strong>
<ul>
<li><a href="https://documentation.cash/protocol/forks/may-2018-reenabled-opcodes" rel="nofollow noreferrer">OP_CAT, OP_SPLIT, OP_AND, OP_OR, OP_XOR, OP_DIV, OP_MOD, OP_BIN2NUM, OP_NUM2BIN</a></li>
<li><a href="https://documentation.cash/protocol/forks/hf-20181115#summary" rel="nofollow noreferrer">OP_CHECKDATASIG, OP_CHECKDATASIGVERIFY, and more malleabiliy fixes (&quot;push only&quot; and &quot;clean stack&quot; rules)</a>. This made the precedent of allowing Script to &quot;look&quot; at other inputs &amp; outputs in the same transaction, which enabled first covenants.</li>
</ul>
</li>
<li><strong>2019</strong>
<ul>
<li><a href="https://documentation.cash/protocol/forks/hf-20190515#summary" rel="nofollow noreferrer">Schnorr signatures</a></li>
<li><a href="https://documentation.cash/protocol/forks/hf-20191115#summary" rel="nofollow noreferrer">Schnorr multisig, and more malleability fixes (minimal push and minimal number encoding)</a></li>
</ul>
</li>
<li><strong>2020</strong>
<ul>
<li><a href="https://documentation.cash/protocol/forks/hf-20200515#op_reversebytes" rel="nofollow noreferrer">OP_REVERSEBYTES</a></li>
</ul>
</li>
<li><strong>2021</strong>
<ul>
<li><a href="https://documentation.cash/protocol/forks/chips/2021-05-multiple-op-returns-for-bitcoin-cash" rel="nofollow noreferrer">Allow multiple OP_RETURNs</a></li>
</ul>
</li>
<li><strong>2022</strong>
<ul>
<li><a href="https://documentation.cash/protocol/forks/chips/2022-05-bigger-script-integers#summary" rel="nofollow noreferrer">SriptVM 64-byte integer support, enabled OP_MUL</a></li>
<li><a href="https://documentation.cash/protocol/forks/chips/2022-05-native-introspection-opcodes" rel="nofollow noreferrer">Native introspection opcodes</a>: OP_INPUTINDEX, OP_ACTIVEBYTECODE, OP_TXVERSION, OP_TXINPUTCOUNT, OP_TXOUTPUTCOUNT, OP_TXLOCKTIME, OP_UTXOVALUE, OP_UTXOBYTECODE, OP_OUTPOINTTXHASH, OP_OUTPOINTINDEX, OP_INPUTBYTECODE, OP_INPUTSEQUENCENUMBER, OP_OUTPUTVALUE, OP_OUTPUTBYTECODE</li>
</ul>
</li>
<li><strong>2023</strong>
<ul>
<li><a href="https://github.com/bitjson/cashtokens" rel="nofollow noreferrer">CashTokens</a> - native consensus-enforced UTXO token primitives and ScriptVM opcodes (OP_UTXOTOKENCATEGORY, OP_UTXOTOKENCOMMITMENT, OP_UTXOTOKENAMOUNT, OP_OUTPUTTOKENCATEGORY, OP_OUTPUTTOKENCOMMITMENT, OP_OUTPUTTOKENAMOUNT) to integrate them with contracts</li>
<li><a href="https://gitlab.com/0353F40E/p2sh32/-/blob/main/CHIP-2022-05_Pay-to-Script-Hash-32_(P2SH32)_for_Bitcoin_Cash.md" rel="nofollow noreferrer">Address the hash collision problem by enabling a 32-byte BIP-0016 output pattern - P2SH32</a></li>
</ul>
</li>
</ul>
<p><strong>Turing completeness</strong></p>
<p>Bitcoin Cash Script is not Turing-complete but OP_CHECKDATASIG (2018) and introspection opcodes (2022) made transaction chains Turing-complete. There's been some work discussing why this is so: <a href="https://www.semanticscholar.org/paper/Self-Reproducing-Coins-as-Universal-Turing-Machine-Chepurnoy-Kharin/05c6514c671d380cb2aa02ffa504bb4faca7b92c" rel="nofollow noreferrer">Self-Reproducing Coins as Universal Turing Machine, A. Chepurnoy, Vasily Kharin, D. Meshkov</a></p>
<p>Note that nodes wouldn't be automatically evolving the multi-TX program. Some blockchain-external agent would have to construct the next transaction that satisfies the covenant and then broadcast it to the network. The program could code-in a reward for this and incentivize anyone to construct and post the next transaction, or external agents could do it for free. The program would halt when it runs out of money for the fees/incentives, but then again, other external agents could give it more money to continue evolving.</p>

CC BY-SA 4.0
2022-11-04T18:06:56.360Z
2023-05-19T11:55:24.690Z
2023-05-19T11:55:24.690Z
bca-0353f40e
<p>Bitcoin’s Script is the forth-like, non-Turing complete language used for transactions. However, in practice, a very limited number of kinds of scripts are allowed, a number of opcodes have been disabled, and even a number of bugs in script have to be replicated to maintain consensus.</p>

<p>Have there been any innovations by the altcoin community, in their forks of Bitcoin’s Script? Any with non-secp256k1 crypto? Any with more functional bignum / arbitrary integer functionality that can do cryptographic primitives? Any that add Turing complete functionality?</p>

CC BY-SA 3.0
2015-12-17T20:27:18.760Z
Not anything significant that I know of. Note that more and more operators in the Bitcoin script have been/are being re-enabled and other new operator and script features have been/are being implemented. Turing completeness in this context is merely a buzz word that doesn't make sense to begin with. Most use cases need their own P2P network and data storage system (blockchain or otherwise) and only need to anchor hashes in the Bitcoin blockchain (if at all).
Jannes
CC BY-SA 3.0
2015-12-18T13:53:54.767Z
Hi Christopher, have you looked into Ethereum at all? I don't know much about its scripting procedures, but I know it's touted as being Turing complete, and just generally more featureful. More complexity opens the door for more attack vectors, though. This seems like a good starting point: https://ethereum.gitbooks.io/frontier-guide/content/writing_contract.html
morsecoder
CC BY-SA 3.0
2015-12-24T10:22:00.813Z
"Turing complete" is basically nonsense, the authors don't even call it that.
Claris
<script><altcoin>
Any Innovations in altcoin tech for Bitcoin’s Script language?
Christopher Allen
# Any Innovations in altcoin tech for Bitcoin’s Script language?

(Asked by: username_0 on 2015-12-17)

Bitcoin’s Script is the forth-like, non-Turing complete language used for transactions. However, in practice, a very limited number of kinds of scripts are allowed, a number of opcodes have been disabled, and even a number of bugs in script have to be replicated to maintain consensus.

Have there been any innovations by the altcoin community, in their forks of Bitcoin’s Script? Any with non-secp256k1 crypto? Any with more functional bignum / arbitrary integer functionality that can do cryptographic primitives? Any that add Turing complete functionality?

**Tags:** script, altcoin

> **Comments:**
> **username_1**: Not anything significant that I know of. Note that more and more operators in the Bitcoin script have been/are being re-enabled and other new operator and script features have been/are being implemented. Turing completeness in this context is merely a buzz word that doesn't make sense to begin with. Most use cases need their own P2P network and data storage system (blockchain or otherwise) and only need to anchor hashes in the Bitcoin blockchain (if at all).  
> **username_2**: Hi username_0, have you looked into Ethereum at all? I don't know much about its scripting procedures, but I know it's touted as being Turing complete, and just generally more featureful. More complexity opens the door for more attack vectors, though. This seems like a good starting point: https://ethereum.gitbooks.io/frontier-guide/content/writing_contract.html  
> **username_3**: "Turing complete" is basically nonsense, the authors don't even call it that.  

---

## 1 answers

### Answer by username_4 on 2022-11-04. Score: 4

Bitcoin Cash is a code and blockhain fork (blocks 0 to 478558 are the same on both blockchains) which did the following upgrades to Bitcoin Script VM:

* **2017** Malleability fixes
  + [Mandatory use of SCRIPT\_VERIFY\_STRICTENC](https://documentation.cash/protocol/forks/bch-uahf#req-6-4-mandatory-use-of-script_verify_strictenc)
  + [Enforcement of LOW\_S signatures and NULLFAIL (BIP-0146)](https://documentation.cash/protocol/forks/hf-20171113#summary)
* **2018**
  + [OP\_CAT, OP\_SPLIT, OP\_AND, OP\_OR, OP\_XOR, OP\_DIV, OP\_MOD, OP\_BIN2NUM, OP\_NUM2BIN](https://documentation.cash/protocol/forks/may-2018-reenabled-opcodes)
  + [OP\_CHECKDATASIG, OP\_CHECKDATASIGVERIFY, and more malleabiliy fixes ("push only" and "clean stack" rules)](https://documentation.cash/protocol/forks/hf-20181115#summary). This made the precedent of allowing Script to "look" at other inputs & outputs in the same transaction, which enabled first covenants.
* **2019**
  + [Schnorr signatures](https://documentation.cash/protocol/forks/hf-20190515#summary)
  + [Schnorr multisig, and more malleability fixes (minimal push and minimal number encoding)](https://documentation.cash/protocol/forks/hf-20191115#summary)
* **2020**
  + [OP\_REVERSEBYTES](https://documentation.cash/protocol/forks/hf-20200515#op_reversebytes)
* **2021**
  + [Allow multiple OP\_RETURNs](https://documentation.cash/protocol/forks/chips/2021-05-multiple-op-returns-for-bitcoin-cash)
* **2022**
  + [SriptVM 64-byte integer support, enabled OP\_MUL](https://documentation.cash/protocol/forks/chips/2022-05-bigger-script-integers#summary)
  + [Native introspection opcodes](https://documentation.cash/protocol/forks/chips/2022-05-native-introspection-opcodes): OP\_INPUTINDEX, OP\_ACTIVEBYTECODE, OP\_TXVERSION, OP\_TXINPUTCOUNT, OP\_TXOUTPUTCOUNT, OP\_TXLOCKTIME, OP\_UTXOVALUE, OP\_UTXOBYTECODE, OP\_OUTPOINTTXHASH, OP\_OUTPOINTINDEX, OP\_INPUTBYTECODE, OP\_INPUTSEQUENCENUMBER, OP\_OUTPUTVALUE, OP\_OUTPUTBYTECODE
* **2023**
  + [CashTokens](https://github.com/bitjson/cashtokens) - native consensus-enforced UTXO token primitives and ScriptVM opcodes (OP\_UTXOTOKENCATEGORY, OP\_UTXOTOKENCOMMITMENT, OP\_UTXOTOKENAMOUNT, OP\_OUTPUTTOKENCATEGORY, OP\_OUTPUTTOKENCOMMITMENT, OP\_OUTPUTTOKENAMOUNT) to integrate them with contracts
  + [Address the hash collision problem by enabling a 32-byte BIP-0016 output pattern - P2SH32](https://gitlab.com/0353F40E/p2sh32/-/blob/main/CHIP-2022-05_Pay-to-Script-Hash-32_(P2SH32)_for_Bitcoin_Cash.md)

**Turing completeness**

Bitcoin Cash Script is not Turing-complete but OP\_CHECKDATASIG (2018) and introspection opcodes (2022) made transaction chains Turing-complete. There's been some work discussing why this is so: [Self-Reproducing Coins as Universal Turing Machine, A. Chepurnoy, Vasily Kharin, D. Meshkov](https://www.semanticscholar.org/paper/Self-Reproducing-Coins-as-Universal-Turing-Machine-Chepurnoy-Kharin/05c6514c671d380cb2aa02ffa504bb4faca7b92c)

Note that nodes wouldn't be automatically evolving the multi-TX program. Some blockchain-external agent would have to construct the next transaction that satisfies the covenant and then broadcast it to the network. The program could code-in a reward for this and incentivize anyone to construct and post the next transaction, or external agents could do it for free. The program would halt when it runs out of money for the fees/incentives, but then again, other external agents could give it more money to continue evolving.


---

