Gas is a unit that measures how much computational work a blockchain must perform to process a transaction or execute a smart contract. While the term is most closely associated with Ethereum, the concept applies broadly to smart contract networks that need a consistent way to price computation and prevent spam.
How gas works on Ethereum
On Ethereum, each action has a gas cost based on the resources it consumes. A simple ETH transfer typically uses a fixed amount of gas, while interacting with a DeFi protocol, minting an NFT, or executing a complex smart contract function can require far more. Users pay fees denominated in ETH, but the fee is calculated from gas usage.
Two related parameters shape what you pay. The gas limit is the maximum amount of gas you are willing to allow for your transaction, acting as a cap on computational effort. If the limit is set too low for a complex contract call, the transaction can fail after consuming the provided gas. The gas price is what you offer per unit of gas, which influences how quickly validators include your transaction when network demand is high.
Why gas fees exist and what affects them
Gas fees compensate validators for processing transactions and for the operational costs of securing the network. They also create an economic barrier against abusive behavior, since executing computation is never free.
In practice, gas becomes most noticeable during periods of congestion. For example, when many users try to trade on decentralized exchanges or mint popular NFT collections at once, competition for block space can push users to bid higher gas prices to get included sooner.
Understanding gas matters because it directly affects the cost, reliability, and user experience of using dApps, and it shapes how developers design efficient smart contracts across the crypto ecosystem.