|
|
|
|
|
by mannykannot
3907 days ago
|
|
I am curious how one goes about verifying that these "trustless transactions of arbitrary (turing-complete!) complexity" will have the behavior that you expect (as a participant) or intend (as an author) for them to have, and that they are proof from subversion by a malicious counter- or third party. After all, this is not exactly a solved problem anywhere else Turing-complete complexity is employed, and it would seem to nullify the point of trustlessness if you are relying on someone else's word on this matter. |
|
The source code for the contract can be made to have a proof of correctness in it, or, as it is probably not all that long, if you look at the source code long enough you can be sufficiently convinced that it runs how you expect it to.
Regarding the problems with turing completeness, any transaction is guaranteed to finish within a particular number of steps, because the transaction includes an amount of "gas", which puts a limit to how many steps the contract will run. If it runs out of gas before finishing, all the changes in the state are reverted (but the person still pays the gas cost). If it finishes, then the extra "gas" is returned. (the transaction specifies some "gas cost", which is how much ether per gas or gas per ether (idr) , and some amount of ether, which is the max cost the transaction is allowed to take. There aren't "gas balances", any "gas" that is transferred just is ether at the end. Its just a unit of how much computation, and the gas price is how much they are willing to pay per amount of computation. I feel like I didn't explain this well...)
Checking that the contracts were run correctly is done by anyone verifying the block which contains the contract call. If the miner runs the contract incorrectly, then the people verifying the block will not accept the block as valid, so people won't mine on the block, so it wont end up in the main chain, so the miner will not receive anything from mining the block, and what happens in the wrong execution wont effect anything.
I'm not sure if this explanation has been very clear, but I hope it has been clear enough. I can try again if it isn't though.