Skip to main content

Bitcoin: A Total Turing Machine

  • Conference paper
  • First Online:

Part of the book series: Advances in Intelligent Systems and Computing ((AISC,volume 1037))

Abstract

We demonstrate that the Bitcoin script language allows not only for primitive recursion, but in the deployment of an Ackermann function and hence the ability to simply recurse in Bitcoin script, we show that the script system is Turing complete. From there, we introduce a new class of Turing machine, the PTTM or probabilistic total Turing machine, and note that Bitcoin acts as a decider or total Turing machine which allows us to find a NIZKPoK that can act as a TM-based verifier to a non-interactive proof that is run on an external and non-associated TM as a proof system. Bitcoin can extend to securely offer contracts such as best fit solutions to common logistic systems and optimisation problems including the travelling salesman class of problems and to the optimisation of systems. It can be offered as an open or time-bound contract that guarantees payment and can be solved by allowing pseudonymity of the bidder.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   169.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   219.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Notes

  1. 1.

    See https://asecuritysite.com/encryption/maze as an example.

References

  1. Blum, M., Feldman, P., Micali, S.: Non-interactive zero-knowledge and its applications. In: Proceedings of the 20th Annual ACM Symposium on Theory of Computing (STOC 1988), pp. 103–112. ACM, Chicago (1988)

    Google Scholar 

  2. Brainerd, W.S., Landweber, L.H.: Theory of Computation, 1st edn. Wiley, New York (1974)

    MATH  Google Scholar 

  3. Cobham, A.: The intrinsic computational difficulty of functions. In: Bar-Hillel, Y. (ed.) Logic, Methodology and Philosophy of Science: Proceedings of the 1964 International Congress. Studies in Logic and the Foundations of Mathematics, pp. 24–30. North-Holland Publishing, Cambridge (1965)

    Google Scholar 

  4. Davis, M.: The Undecidable, Basic Papers on Undecidable Propositions, Unsolvable Problems And Computable Functions, 1965th edn. Raven Press, New York (1965)

    MATH  Google Scholar 

  5. Downey, R.G., Hirschfeldt, D.R.: Algorithmic Randomness and Complexity. Theory and Applications of Computability, 1st edn. Springer, New York (2010)

    Book  Google Scholar 

  6. Enderton, H.B.: Elements of recursion theory. In: Barwise, J. (ed.) Handbook of Mathematical Logic, pp. 527–566. North-Holland, Amsterdam (1977)

    Chapter  Google Scholar 

  7. Gödel, K.: Ueber formal unentscheidbare Saetze der Principia Mathematica und verwandter Systeme. Monatshefte fuer Mathematik und Physik 38(1), 173–198 (1931)

    Article  Google Scholar 

  8. Goldwasser, S., Micali, S., Rackoff, C.: Knowledge complexity of interactive proof systems. SIAM J. Comput. 18(1), 186–208 (1989)

    Article  MathSciNet  Google Scholar 

  9. Hazewinkel, M.: Ackermann function. In: Encyclopedia of Mathematics, 2001 edn. Springer, Dordrecht (2001)

    Google Scholar 

  10. Hopcroft, J.E., Ullman, J.D.: Nonerasing stack automata. JCSS 1(2), 166–186 (1967)

    MATH  Google Scholar 

  11. Hopcroft, J.E., Ullman, J.D.: Deterministic stack automata and the quotient operator. JCSS 2, 1–12 (1968)

    MathSciNet  MATH  Google Scholar 

  12. Hopcroft, J.E., Ullman, J.D.: Two results on one-way stack automata. In: 8th Annual Symposium on Switching and Automata Theory (SWAT 1967), pp. 37–44. IEEE, Austin (1967)

    Google Scholar 

  13. Kozen, D.C.: Automata and Computability. Springer, New York (1997)

    Book  Google Scholar 

  14. de Leeuw, K., Moore, E.F., Shannon, C.E., Shapiro, N.: Computability by probabilistic machines. In: Shannon, C.E., McCarthy, J. (eds.) Annals of Mathematics Studies. Automata Studies, vol. 34, pp. 183–212. Princeton University Press, Princeton (1956)

    Google Scholar 

  15. Meyer, A.R., Ritchie, D.M.: The complexity of loop programs. In: Proceedings of the 22nd ACM National Conference, pp. 465–469. Thompson Book Co., Washington D.C. (1967)

    Google Scholar 

  16. Rosser, J.B.: An informal exposition of proofs of Godel’s theorem and Church’s theorem. J. Symb. Log. 4(2), 53–60 (1939)

    Article  Google Scholar 

  17. Ginsburg, S., Greibach, S.A., Harrison, M.A.: Stack automata and compiling. J. ACM 14(1), 172–201 (1967)

    Article  MathSciNet  Google Scholar 

  18. Sipser, M.: Introduction to the Theory of Computation, 1st edn. PWS Publishing Co., Boston (1996)

    MATH  Google Scholar 

  19. Turing, A.M.: Systems of logic based on ordinals. In: Proceedings of the London Mathematical Society, s. 2, vol. 45, Part 3, pp. 161–228. C.F. Hidgson & Son, London (1939)

    Google Scholar 

  20. Wirth, N.: Algorithms + Data Structures = Programs, 1st edn. Prentice-Hall, London (1976)

    MATH  Google Scholar 

  21. Wright, C.S.: A proof of turing completeness in Bitcoin script (2017). To be published in a journal. SSRN: https://ssrn.com/abstract=3265157 or http://dx.doi.org/10.2139/ssrn.3265157

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Craig S. Wright .

Editor information

Editors and Affiliations

A Appendix

A Appendix

Script 1 - Two-Argument Ackerman Function

The following script is an example (the two—argument version) of the Ackerman function [9].

$$ A\left( {m,n} \right) = \left\{ {\begin{array}{*{20}c} {n + 1} \\ {A\left( {m - 1,1} \right)} \\ {A\left( {m - 1,\left( {A\left( {m,n - 1} \right)} \right)} \right)} \\ \end{array} } \right.\begin{array}{*{20}c} {} \\ {} \\ {} \\ \end{array} \begin{array}{*{20}c} {} \\ {} \\ {} \\ \end{array} \begin{array}{*{20}c} {if} \\ {if} \\ {if} \\ \end{array} \begin{array}{*{20}c} {} \\ {} \\ {} \\ \end{array} \begin{array}{*{20}c} {\left( {m = 0} \right)} \\ {\left( {m > 0} \right)\& \left( {n = 0} \right)} \\ {\left( {m > 0} \right)\& \left( {n > 0} \right)} \\ \end{array} $$
(1)

This function can be included in Bitcoin script as a construct using the opcode commands:

  • OP_1ADD

  • OP_1SUB

  • OP_TOALTSTACK

  • OP_FROMALTSTACK

  • OP_IF

  • OP_ELSEIF

  • OP_DUP

  • OP_OVER, OP_ROLL, OP_ROT, OP_SWAP, OP_TUCK, OP_PICK

  • OP_EQUAL

  • OP_GREATERTHAN

Other OP_Codes are required to push data, create the recursion and to output information and in the creation of more efficient variants of this process. These are not detailed here.

Script 2 – Probabilistic TTM

The following is a simple recursive script that acts stochastically based on a pseudo random value calculated form the input values.

This function can be included in Bitcoin script as a construct using the opcode commands:

  • OP_MAX

  • OP_MIN

  • OP_WITHIN

  • OP_HASH256

  • OP_TOALTSTACK

  • OP_FROMALTSTACK

  • OP_IF

  • OP_OVER, OP_ROLL, OP_ROT, OP_SWAP, OP_TUCK, OP_Pick

  • OP_EQUAL

  • OP_GREATERTHAN

stringtoconcatenate OP_CAT OP_SHA256 00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048 OP_LESSTHAN OP_VERIFY OP_DROP OP_DUP OP_HASH160 e6ee700d3b22c43b4ad5d4144ae16d35a0013bc0 OP_EQUALVERIFY OP_CHECKSIG

Compiler Options

The following constructs can be extended into:

  1. 1.

    Recursion constructs

    1. a.

      Primitive recursive systems

    2. b.

      Simple recursion

  2. 2.

    Decision Tree elements and Decision trees

  3. 3.

    High level language constructs

  4. 4.

    Extended Output and reporting systems

  5. 5.

    Prunable message systems

Decision Tree Elements

Any decision tree consists of three types of nodes:

  1. 1.

    Decision nodes - commonly represented by squares

  2. 2.

    Chance nodes - represented by circles

  3. 3.

    End nodes - represented by triangles

A simple high level system can be created to incorporate data, the calculation of chance (probability using a PTTM) and output.

There are many methods to have data presented in a UTXO or as a ‘prunable’ value. OP_Return can be used to insert data, then be pruned in time, before it reaches the blockchain so you can avoid spam or bloat. This allows it to be a free ride for messaging or ads (and it was better when there was IP-to-IP transfer). It also allows paid messaging on the blockchain equivalent to Snapchat using a patent no. 42 encrypted exchange. As such, we encrypt using no. 42 to a party, attach a file (which will be pruned later), and decrypt when it is spent.

An example of a use would include allowing people to watch an ad and get their TX sent for free. This is another way Bitcoin can actually be income producing.

This is one of the reasons for TX Malleability. We can add and prune OP_Returns.

The output associated with an OP_RETURN function can be linked to a zero value (no BTC) exchange. When this in attached to a transaction that is created using different hashtypes. The combination:

  • SIGHASH_SINGLE; and

  • SIGHASH_ANYONECANPAY

allows us to add zero value output scripts, including OP_Return. A script consisting of OP_RETURN followed a pushdata op allows for the addition of a provably unspendable value and hence why we would desire to make the included value zero. It is usually considered non-standard (though valid) for a transaction to have more than one OP_RETURN output or an OP_RETURN output with more than one pushdata op. This can also be extended to allow for calculations and complex scripts that are loaded using a later pushdata op.

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Wright, C.S. (2020). Bitcoin: A Total Turing Machine. In: Bi, Y., Bhatia, R., Kapoor, S. (eds) Intelligent Systems and Applications. IntelliSys 2019. Advances in Intelligent Systems and Computing, vol 1037. Springer, Cham. https://doi.org/10.1007/978-3-030-29516-5_18

Download citation

Publish with us

Policies and ethics