4 ms·
The post insinuates that the etherium scripting language is Turing complete. How can that be safe?
by kochthesecond 9y ago
The post insinuates that the etherium scripting language is Turing complete. How can that be safe?
- geedy 9y agoYou will have to define "safe", but in general things like infinite loops are effectively bound by the amount of gas provided. Mistakes are still expensive, and it is easy to get the code wrong (the DAO hack and quadrigacx screw up this week are obvious examples), but the network itself is fairly stable, which is priority number one.
- pault 9y agoIs there an analysis/post-mortem on the QuadrigaCX snafu anywhere? I would be very interested in reading a detailed account of exactly what went wrong.
- DennisP 9y agoHere's their comment: https://www.reddit.com/r/ethereum/comments/6ettq5/statement_on_quadrigacx_ether_contract_error/ https://www.reddit.com/r/ethereum/comments/6ettq5/statement_... Also, it's normal practice for a contract to throw an exception if ETH is sent to any function that doesn't know how to deal with it. This includes the "fallback function," which is what runs if no other function in the contract is called. With recent versions of Solidity, this throw is built in, unless you mark a function "payable." But they were using an older contract, and there was no protection built into their fallback, and that's what made them vulnerable to this issue in the first place.
- DennisP 9y agoIndeed it is, aside from the fact that you pay a transaction fee for every step so at some point you run out of money. Some other things that run on Turing-complete code: passenger jets, medical equipment, self-driving cars, and nuclear reactors. I write and audit Ethereum scripts for a living. It takes a lot of care, but it's manageable because the scripts are typically under a thousand lines total, implementing simple business rules rather than complicated algorithms. It's feasible to make it very solid if you take your time, make the code as simple and clear as possible, write lots of unit tests, hire expert review, publish the code and maybe post a bounty. It's also good practice to build in something to handle emergencies, just in case. People are working on formal verification for Ethereum contracts, so down the road we should be able to actually prove their properties.
- seibelj 9y agoHi Dennis, could you send me an email to the address in my profile? May have some ethereum work for you. Didn't see an address in your profile. Thanks
- codesushi42 9y agoIt runs in a sandboxed virtual machine, the EVM. There is still the issue of the halting problem. But programs that would run infinitely have a finite amount of gas, and will eventually stop executing. Even if you staged an attack using a large sum of ether to fund a large amount of gas, the EVM still has a hard limit on the number of computational steps per block. There is also still the issue of a developer writing a buggy contract (see the DAO exploit). But static analyzers and automated proofs can help address this in the future.
- mbrock 9y agoWhat exactly do you mean by "Turing complete" and why do you believe this property to be dangerous?
- kochthesecond 9y agoBecause it sounds like an attack vector for running abitrary code on every node in the network. Additionally there is the halting problem, you can not know if the program will halt by looking at it.