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
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsNotes
- 1.
See https://asecuritysite.com/encryption/maze as an example.
References
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)
Brainerd, W.S., Landweber, L.H.: Theory of Computation, 1st edn. Wiley, New York (1974)
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)
Davis, M.: The Undecidable, Basic Papers on Undecidable Propositions, Unsolvable Problems And Computable Functions, 1965th edn. Raven Press, New York (1965)
Downey, R.G., Hirschfeldt, D.R.: Algorithmic Randomness and Complexity. Theory and Applications of Computability, 1st edn. Springer, New York (2010)
Enderton, H.B.: Elements of recursion theory. In: Barwise, J. (ed.) Handbook of Mathematical Logic, pp. 527–566. North-Holland, Amsterdam (1977)
Gödel, K.: Ueber formal unentscheidbare Saetze der Principia Mathematica und verwandter Systeme. Monatshefte fuer Mathematik und Physik 38(1), 173–198 (1931)
Goldwasser, S., Micali, S., Rackoff, C.: Knowledge complexity of interactive proof systems. SIAM J. Comput. 18(1), 186–208 (1989)
Hazewinkel, M.: Ackermann function. In: Encyclopedia of Mathematics, 2001 edn. Springer, Dordrecht (2001)
Hopcroft, J.E., Ullman, J.D.: Nonerasing stack automata. JCSS 1(2), 166–186 (1967)
Hopcroft, J.E., Ullman, J.D.: Deterministic stack automata and the quotient operator. JCSS 2, 1–12 (1968)
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)
Kozen, D.C.: Automata and Computability. Springer, New York (1997)
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)
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)
Rosser, J.B.: An informal exposition of proofs of Godel’s theorem and Church’s theorem. J. Symb. Log. 4(2), 53–60 (1939)
Ginsburg, S., Greibach, S.A., Harrison, M.A.: Stack automata and compiling. J. ACM 14(1), 172–201 (1967)
Sipser, M.: Introduction to the Theory of Computation, 1st edn. PWS Publishing Co., Boston (1996)
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)
Wirth, N.: Algorithms + Data Structures = Programs, 1st edn. Prentice-Hall, London (1976)
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
Author information
Authors and Affiliations
Corresponding author
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].
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.
Recursion constructs
-
a.
Primitive recursive systems
-
b.
Simple recursion
-
a.
-
2.
Decision Tree elements and Decision trees
-
3.
High level language constructs
-
4.
Extended Output and reporting systems
-
5.
Prunable message systems
Decision Tree Elements
Any decision tree consists of three types of nodes:
-
1.
Decision nodes - commonly represented by squares
-
2.
Chance nodes - represented by circles
-
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
Copyright information
© 2020 Springer Nature Switzerland AG
About this paper
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
DOI: https://doi.org/10.1007/978-3-030-29516-5_18
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-29515-8
Online ISBN: 978-3-030-29516-5
eBook Packages: Intelligent Technologies and RoboticsIntelligent Technologies and Robotics (R0)