“Turing-complete” sounds like a promise to run anything. On a blockchain, that phrase needs a resource boundary.
This is a written companion to my new visual explainer, moving from Turing machines to Bitcoin Script and the EVM.
Expressiveness is only the first question
Turing completeness describes an idealized computational model that can simulate any Turing machine, given sufficient time and storage. Real machines have finite resources. Ethereum also imposes explicit execution limits.
Bitcoin Script checks the conditions for spending a UTXO. Traditional Script is deliberately constrained and lacks general loops; that does not mean Bitcoin has no programmable spending rules. The EVM supports a broader execution model, including conditional jumps that can form loops.
A terminating loop can still fail
Consider this pseudocode, not EVM bytecode or a gas estimate:
result = 0
repeat 1,000 times:
result = result + 3
The mathematical computation terminates. An execution can still run out of gas before finishing. Gas cost depends on the actual instructions and execution context, not just the number of loop iterations.
A loop with no exit cannot force validators to execute forever either: a transaction has a finite gas budget. Metering bounds execution; it does not solve the general halting problem.
Three questions help keep the concepts separate:
- Can the idealized model express the computation?
- Will this particular program halt?
- Can this execution finish within its resource budget?
Watch the visual walkthrough
English, about 14 minutes:
中文 Bilibili 版本 · 中文 YouTube 版本
Which of those three questions causes the most confusion when learning smart contracts?
References: Ethereum whitepaper — scripting and execution limits, EVM documentation. The whitepaper is a historical reference, not a current gas-price specification.
Disclosure: this written companion was drafted by an AI assistant using my video topic, sampled video sections and the linked references.
Top comments (0)