Foundations

Understanding Gas & Transaction Fees

Why crypto transactions cost money, what gas is, and how to avoid overpaying.

Gas is the unit that measures how much computational work a transaction requires on a blockchain — and it determines how much you pay in fees. If you have ever sent a transaction and been surprised by the cost, or wondered why fees spike unpredictably, understanding gas is the missing piece.

Why transactions cost money at all

Blockchains are maintained by a decentralized network of computers. Each of those computers spends real resources — electricity, hardware, bandwidth — to process and validate transactions. Fees are how the network compensates those operators, which in turn keeps the network running without any central company footing the bill.

Without fees, the network would be vulnerable to spam: anyone could flood it with millions of trivial transactions at no cost, grinding it to a halt. Fees create a natural economic filter. Only transactions that are worth at least what they cost will actually be submitted.

To understand how fees are calculated, it helps to separate two concepts: the amount of work a transaction requires, and the price you are willing to pay per unit of work.

What gas actually measures

On Ethereum and networks that follow its model, “gas” measures computational effort. Different operations cost different amounts of gas:

  • A simple ETH transfer uses a fixed 21,000 gas units
  • Calling a smart contract function uses more, depending on complexity
  • Deploying a brand-new contract uses even more

Gas units themselves are not a currency. They are a fixed measure of work, like kilowatt-hours measuring electricity. A simple transfer always costs 21,000 gas — that never changes. What changes is the price of each gas unit, denominated in the network’s native token.

How the fee is calculated

Your total transaction fee is:

Fee = Gas units used x Gas price per unit

On Ethereum after the EIP-1559 upgrade (which introduced a fee market overhaul), the gas price has two components:

ComponentWhat it isWho receives it
Base feeMinimum price the network requires right nowBurned (destroyed)
Priority fee (tip)Optional extra to attract validatorsThe validator

The base fee is set algorithmically — it rises when blocks are full and falls when they are less than half full. This means fees reflect actual network congestion rather than pure bidding wars. The tip is your way of signaling urgency. Validators process higher-tip transactions first.

When you submit a transaction, you also set a max fee — the absolute ceiling you are willing to pay per gas unit. If the base fee is lower than your max fee, the difference (minus your tip) is refunded to you. You never pay more than your max fee, and you rarely pay the full maximum.

Why fees vary so much

Fees are not fixed because block space is a shared, scarce resource. Each block has a maximum amount of gas it can contain. When many users want their transactions included quickly, they compete by raising their tips. This is why fees surge during popular NFT drops, token launches, or periods of market volatility — demand for block space spikes faster than supply can respond.

The analogy of a highway toll helps here. When traffic is light, the toll is low. During rush hour, the price rises to manage congestion. You can choose to pay the rush-hour price or wait until things calm down.

Network congestion is also why layer 2 solutions were built. By handling most transactions off the main chain and only settling summaries on it, they dramatically reduce the gas each user pays. Rollups in particular batch hundreds of transactions together and split the base-layer fee among all of them.

Gas on other blockchains

Bitcoin does not use the term “gas” — its fee model is simpler. Bitcoin fees are based on the size of a transaction in bytes, not computational complexity. Since Bitcoin transactions are simpler by design, fee calculation is more straightforward, though it can still spike during congestion.

Solana uses a different model: a very low base fee per transaction, with an optional priority fee. Its architecture allows for much higher transaction throughput, which generally keeps fees low. Other chains like Avalanche and Polygon also have their own fee markets, usually calibrated to their own native tokens and block sizes.

The specific mechanics differ, but the underlying logic is the same everywhere: fees compensate node operators and ration scarce block space.

How to avoid overpaying

A few practical habits help keep fees reasonable:

Time your transactions. Network congestion follows patterns. Weekdays during peak trading hours in major markets tend to be more expensive. Late nights or weekends (in UTC) are often quieter. Tools that show historical fee trends can help you identify cheap windows.

Use your wallet’s fee settings. Most modern crypto wallets let you choose a fee tier — something like “slow,” “standard,” or “fast.” Slow transactions may take longer but cost less. Only choose “fast” when you genuinely need speed. For non-urgent transactions, “slow” usually still confirms within a reasonable time.

Understand what you are signing. Before confirming a transaction, read the estimated fee. If a swap or contract interaction shows an unexpectedly high gas estimate, that is often a sign something is wrong — a broken contract, a failed simulation, or a misconfigured interaction.

Consider layer 2 networks. If you are regularly interacting with applications on Ethereum, moving to a layer 2 like Arbitrum or Optimism for everyday activity can reduce your fees by orders of magnitude.

Do not set your max fee too low. If you set a max fee below the current base fee, your transaction will sit unprocessed in the mempool until the base fee drops to meet it — or until you cancel it. Most wallets auto-suggest sensible values; it is usually safe to accept those defaults unless you have a specific reason to adjust.

Key takeaways

  • Gas measures the computational work a transaction requires; it is not a currency itself.
  • Your fee equals gas units used multiplied by the gas price, which fluctuates with network demand.
  • On Ethereum, fees have a base fee (burned) and an optional tip (paid to validators); you set a max fee as a ceiling.
  • Fees exist to compensate network operators and prevent spam — they are a feature, not a flaw.
  • Timing transactions during low-congestion periods and using layer 2 networks are the two most effective ways to reduce what you pay.
  • Never set your max fee so low that it falls below the base fee, or your transaction will stall.

Next up: Reading a Crypto Chart