Gas (Ethereum)

Gas is the unit that measures the amount of computational effort required to execute a specific operation on the ethereum network. Every EVM opcode costs a defined amount of gas; users set a gas limit (maximum gas they’ll spend) and pay a gas fee in ETH.

Gas price mechanics: Pre-eip-1559, users competed in a first-price auction. Post-EIP-1559 (August 2021), the protocol calculates a base fee (burned) plus an optional tip (validator priority fee).

Why it exists: Gas decouples Ethereum’s unit of account (ETH, which is volatile) from the cost of computation. It also prevents infinite loops and spam by making every instruction cost real resources.

Referenced in: eip-1559, ethereum-virtual-machine