5 ms·
I think @mannykannot misunderstands the purpose of gas in Ethereum. It's only purpose is a solution to the Halting Problem [1]. Alternative solution could be di
by nivertech 11y ago
I think @mannykannot misunderstands the purpose of gas in Ethereum. It's only purpose is a solution to the Halting Problem [1]. Alternative solution could be disallowing jumps backwards / loops or limiting time of the computation.
Why is it the problem? Because contract with something like while(1){}; will render the entire network of nodes useless.
1. https://en.m.wikipedia.org/wiki/Halting_problem https://en.m.wikipedia.org/wiki/Halting_problem
- mannykannot 11y agoI am well aware of the purpose of gas. What I have not seen is any argument (from @drdeca or anyone else) that gas materially simplifies the problem of verifying that a contract behaves properly (from your perspective, as one of the parties to the contract) in all circumstances. The fact that it will always halt is only a tiny step along that road, and if it halts as a result of running out of gas, that is strong evidence that it has not worked as intended. An example may be useful. Suppose I tell you that I have written an Ethereum contract whereby people can loan me money, and after a year, I will pay them back double. Before you enter into one such contract with me, I hope it would cross your mind to wonder if I might actually be running a Ponzi scheme. Don't worry, I say, Ethereum has this gas feature that means the transaction will always halt. How much more confident should that information make you feel? As for your alternatives, gas is essentially the same as limiting the time of computation. If backwards jumps were disallowed, the language would not be even approximately Turing-equivalent.
- nivertech 11y ago1. Gas mechanism has nothing to do with tamper-proofing transactions, thats what blockchain (or more correctly hashchain) is for. 2. There are Turing-complete languages which only allow loops with known number of iterations. 3. Check my presentation, If you want to understand Ethereum programming model: http://www.slideshare.net/mobile/nivertech/ethereum-vm-and-dsls-for-smart-contracts http://www.slideshare.net/mobile/nivertech/ethereum-vm-and-d... IMO Ethereum is just a first step in the right direction, the real solution will need to be much more scalable.
- mannykannot 11y ago> 1. Gas mechanism has nothing to do with tamper-proofing transactions, thats what blockchain (or more correctly hashchain) is for. I am not sure why you are mentioning this here, but if this is what you think I am misunderstanding about gas, perhaps you could point out where you think I made this mistake. >2. There are Turing-complete languages which only allow loops with known number of iterations. You did not originally write "loops with known number of iterations", you wrote "disallowing jumps backwards / loops". > 3. Check my presentation, If you want to understand Ethereum programming model. Based on your contributions to this thread so far, I am not very confident that I will find my specific question addressed, but if you give me a specific slide number to start at, I will give it a look. BTW, do you have an answer to the question I posed in the second paragraph of my previous post?
- nivertech 11y agoAn example may be useful. Suppose I tell you that I have written an Ethereum contract whereby people can loan me money, and after a year, I will pay them back double. Before you enter into one such contract with me, I hope it would cross your mind to wonder if I might actually be running a Ponzi scheme. Don't worry, I say, Ethereum has this gas feature that means the transaction will always halt. How much more confident should that information make you feel? Again, it has nothing to do with gas. You just need to review/audit the contract's source and EVM code and be sure it doesn't have backdoors. For simplicity, you can think about Ethereum Transaction as an RPC call to Ethereum contract, where in addition to arguments (Data), you can also transfer a monetary value (in Ether) and provide fuel (Gas) for contract execution. Gas price (in Ethers) serves the same function as Bitcoin Tx fee. Gas mechanism is just an implementation detail. EDIT: Regarding the contract example you mentioned "unsecured loan", I'm not sure it can be implemented as a "Self-enforcing contract", which is a proper term for "Smart Contracts". If a contract depends on your will or ability of repaying the loan, then it's not a self-enforcing contract. Somebody need to provide a collateral. It doesn't make sense for you to put up a 1001 Ether collateral to take 1000 Ether loan. With smart property represented on the Blockchain you will be able to put up your car or apartment as a collateral for a loan, then it can be made self-enforceable. But it's not there yet. The only way I can see for it to be implemented is with your own token, which will be devaluated each time somebody not repaying the loan in full.