What is gas in Ethereum and how does it work
Ethereum is not free to use. Every operation on the network - sending tokens, calling a contract, minting an NFT - consumes a measured amount of computational work. That measurement is called gas. Think of gas as the kilowatt-hour of Ethereum. Just as your electricity bill charges you for each kilowatt-hour you use, Ethereum charges you for each unit of gas your transaction consumes.
Gas exists because Ethereum is a global computer shared by everyone. If transactions cost nothing, malicious actors could spam the network with infinite loops and pointless computations. The network would grind to a halt. Gas pricing creates a market: users compete for block space, and validators choose which transactions to include. The system is self-regulating.
Opcodes and their fixed costs
Every low-level instruction the Ethereum Virtual Machine (EVM) can execute has a fixed gas cost. These instructions are called opcodes. ADD costs 3 gas. SLOAD, which reads a value from persistent storage, costs 100 gas (or 2,100 in some contexts). SSTORE, which writes to storage, can cost 20,000 gas for a fresh write or 100 gas for updating an existing value. The Ethereum yellow paper defines these costs precisely.
A simple ETH transfer costs 21,000 gas. That is the baseline. A complex DeFi swap that touches multiple contracts might cost 150,000 gas or more. The total gas consumed is the sum of every opcode executed, from the start of the transaction to its completion.
Gas limit vs. gas price
Users set two separate parameters when sending a transaction: the gas limit and the gas price.
The gas limit is the maximum amount of gas the user is willing to consume. It is a cap, not a target. If the transaction actually needs 40,000 gas, but you set a limit of 60,000, you only pay for 40,000. The unused 20,000 is refunded. But if the transaction tries to consume more gas than the limit, it fails - and you still pay for the gas used up to the point of failure. This protects you from runaway code.
The gas price is the fee you offer per unit of gas. Historically, this was a single number in gwei (1 gwei = 0.000000001 ETH). You set a price; miners included your transaction if the price was high enough. This created a first-price auction. Users bid against each other, and wallets often overpaid because nobody knew the true market clearing price.
EIP-1559: base fee and priority tip
In August 2021, Ethereum Improvement Proposal 1559 overhauled the fee market. It replaced the single gas price with two components: a base fee and a priority tip.
The base fee is algorithmically determined by the network. It rises when blocks are more than half full and falls when blocks are less than half full. Every user must pay the current base fee. You cannot opt out. Crucially, the base fee is not paid to validators. It is burned - permanently removed from circulation. This creates deflationary pressure on ETH during periods of high network activity.
The priority tip is optional. It is the extra fee you pay directly to validators to incentivize them to include your transaction ahead of others in the same block. If the network is not congested, you can set the tip to zero and your transaction will still be included eventually. During congestion, a higher tip gets you faster confirmation.
So today, the total fee is: gas used × (base fee + priority tip). The base fee fluctuates with demand. The priority tip is your bribe for speed.
Wallets typically estimate both values for you. They show you a range: low, medium, high priority. The medium estimate usually gets your transaction into the next few blocks. The low estimate might wait minutes or hours.
Why gas matters
Gas is not a bug. It is the mechanism that keeps Ethereum usable. Without it, the network would be a public good with no gatekeeping - and therefore no reliability. Gas aligns incentives. It prevents spam, compensates validators for their hardware costs, and (since EIP-1559) reduces the circulating supply of ETH when the network is busy.
Every Ethereum user pays gas. Every dApp developer optimizes for gas. It is the fundamental unit of cost on the world’s most active smart-contract platform. Understanding gas is understanding how Ethereum pays its bills.
Not financial advice. bidenerc.site publishes market data and general information about Biden Coin. Crypto assets are volatile and you can lose everything you put in. Nothing here is a recommendation to buy, sell or hold, and we make no price predictions.
Prices are sourced from third parties and may be delayed or wrong. Verify anything you intend to act on against a primary source.