4 ms·
No, gas is a synonym for fee. However, gas is its own unit, separate from ETH. Each op code in the EVM has a gas price, depending on the complexity of the inst
by flashmob 9y ago
No, gas is a synonym for fee. However, gas is its own unit, separate from ETH.
Each op code in the EVM has a gas price, depending on the complexity of the instruction. Eg. A store op costs more gas than a comparison op.
When you do a transaction, you specify how much ETH you will pay for one unit of gas. Typical transactions use 21k gas, but contracts need much more.
More info about why it's like that:https://www.cryptocompare.com/coins/guides/what-is-the-gas-in-ethereum/ https://www.cryptocompare.com/coins/guides/what-is-the-gas-i...
I often see 'gas required' 'gas limit' and 'gas price' terms confused, so careful what you read in the comments on the internet ;-)
- mrb 9y agoA much simpler terminology Ethereum should have picked instead of "gas" is the "cycle". Each operation takes a predefined number of cycles to execute. For example SLOAD takes 20 cycles, SSTORE 100 cycles, etc. Then a transaction defines the maximum number of cycles it will need, as well as the ETH per cycle it will pay as a fee. That's it. Basically: gasCost -> cycles gasLimit -> max cycles per transaction gasPrice -> ETH per cycle The fact you need so much text to explain gasCost, gasPrice, etc, perfectly illustrates my point that their "gas" metaphor is the wrong one. Also as xur17 said, "cost" and "price" are too confusable.
- xur17 9y agoThat is much easier to understand. I spent way too much time reading and converting units when trying to send my first transaction. GasCost and gasPrice sound too similar.
- flashmob 9y agoHmm, not sure about cycles too. It sounds more like CPU clock cycles, may be confusing to those who see it that way? Note that there is also one more limit, the max gas per block limit.. Personally, I quite like gas, not too hard for a casual dev like me to understand. However, perhaps in the future it could be something that is totally abstracted, since asking everyone to understand how gas works is too much.
- mrb 9y agoThe fact the #1 comment on this HN submission refers to "something called gas" (as if it was an advanced concept) instead of "fee" is another data point showing the gas metaphor is confusing :) Also gas is not its own unit. gasPrice is the unit. Or... actually it's not even a unit. A "unit" implies a constant. But it's not constant since each tx can set its own gasPrice. The more I think about the cycles metaphor the more I love it. Sorry I have zero sympathy for "gas"
- tsukaisute 9y agoGas is its own unit, decoupled from ETH. Opcodes cost a certain amount of gas to execute [1]. When creating a transaction, a sender sets the maximum amount of gas that they are willing to pay. This is the "gas limit." [1] https://docs.google.com/spreadsheets/d/1m89CVujrQe5LAFJ8-YAUCcNK950dUzMQPMJBxRtGCqs/edit https://docs.google.com/spreadsheets/d/1m89CVujrQe5LAFJ8-YAU...
- mrb 9y agoI know what gas is. It would be more accurate to call it a unitless number describing the relative resource cost factor of each opcode. If you define the term gas as a unit then it refers to both a value, and the unit of that value, which is where most of the confusion comes from. The language "1000 gas" could mean either "1000 wei/szabo/whatever of gas" or "1000 gasCost" which are 2 completely different things!
- tsukaisute 9y ago"This book is five dollars" vs. "The price of this book is five dollars" vs. "This is five dollars" (meaning "this book's price is") vs. "This is five dollars" (meaning "five dollars are sitting here on the table.") I know what you're saying, there is ambiguity, but these make sense to people based on context.
- deleted 9y ago[deleted]
- pauhana 9y agoClearly, it should be called "flooz" not "gas"