What Is Gas and Blockchain Fees

Gas fees measure the computational work a blockchain charges per transaction. How Gas Used, Gas Price

TECH & NETWORKS3 min readBy AlgoSys Editorial TeamPublished Apr 25, 2026Updated Jun 26, 2026
Contents

Gas is a unit of measurement for the computational work that a blockchain network must perform to execute your operation. The idea is simple: every action on the network has a cost, and gas translates the abstract "processor effort" into a concrete quantity you can pay for. This is how the network protects itself from abuse (such as infinite loops in code) and fairly distributes limited resources among all users. The concept originated with Ethereum, where a way was needed to pay for the execution of smart contracts (programs living on the blockchain) and ordinary transfers.

MECHANICS

The final transaction fee is calculated by multiplying two quantities: how much gas the operation actually consumed (Gas Used) by the price per unit of gas (Gas Price). The first quantity reflects the computational weight of the transaction, since different operations consume different amounts of gas: a simple transfer is cheaper, while calling a complex contract is more expensive. The second quantity is set by the user, indicating how much they are willing to pay per unit. When the network is congested and many people want to get a transaction through, everyone competes for the limited space in a block, the gas price rises, and with it the total fee.

KEY COMPONENTS

To understand a transaction bill, you only need to know a handful of related concepts. The limit and actual consumption define the volume of work, the price sets the rate, and the EIP-1559 reform split the payment into two parts that go to different recipients.

  • Gas Limit: the ceiling you set in advance, that is, the maximum gas you allow to be spent on the transaction.
  • Gas Used: how much gas was ultimately consumed during execution (usually less than or equal to the limit).
  • Gas Price: the price per unit of gas you are willing to pay, denominated in the network's native currency (Gwei on Ethereum).
  • Base Fee: the base fee set by the network itself, which is burned with every transaction (introduced by EIP-1559).
  • Priority Fee: an optional tip paid directly to validators to encourage them to include your transaction faster.
  • Sequencer: in rollups, the entity that orders and executes transactions.
  • Bundler: in account abstraction (ERC-4337), the entity that aggregates user operations into ready-to-submit transactions.

APPLICATIONS

Gas fees underpin the entire economics of smart contract platforms: Ethereum, Solana, Arbitrum. They serve as the reward that motivates validators (or miners) to spend their resources processing transactions and maintaining network security. Cost depends directly on the complexity of the operation. A simple coin transfer is nearly free, while a data-heavy DeFi operation, say a swap routed through several pools with multiple contract checks, can cost tens of times more precisely because it consumes a lot of gas. To relieve this burden, Layer 2 solutions such as Arbitrum and Optimism pack many transactions into a single batch and process them all at once, spreading the cost across hundreds of users.

To get a feel for the arithmetic, let's work through a simplified numerical example. Say a simple transfer consumes Gas Used = 21,000, and the gas price during a quiet hour is 20 Gwei. The fee is then 21,000 x 20 = 420,000 Gwei, which is 0.00042 of the native coin. Now imagine peak hour: demand for block space has spiked and Gas Price has risen to 200 Gwei. The amount of work has not changed (still 21,000 gas), but the bill has grown exactly tenfold, to 0.0042 of the coin. The same logic explains why a complex contract costs more than a transfer: it does not pay a higher rate, it simply consumes more units of gas.

Scenario Gas Used Gas Price Fee
Quiet hour 21,000 20 Gwei 0.00042 coin
Peak hour 21,000 200 Gwei 0.0042 coin

TRADE-OFFS

The gas model constantly balances two competing desires: keeping the network secure and keeping it affordable to use. A high fee deters spam and attacks, but during periods of Ethereum congestion that same fee makes small transfers simply uneconomical, since paying a couple of dollars to send a couple of dollars is pointless. Layer 2 solutions and sharding (splitting the network into parallel segments) aim to relieve this tension by raising throughput and lowering the per-transaction cost. The trade-off for this is their own set of compromises: additional trust assumptions or a shift toward less decentralization.

FAQ

What is gas in a blockchain in plain terms?

Gas is a measure of the computational work the network performs to execute your operation. Every action has a cost, and gas translates that processor load into a concrete quantity you can pay for. This is how the network protects itself from spam and abuse and fairly distributes resources among users.

How exactly is a transaction fee calculated?

The fee equals the gas consumed (Gas Used) multiplied by the gas price (Gas Price). Consumption depends on the complexity of the operation, and the price is set by the user and pushed up by network demand. Since EIP-1559, the payment is split into a base fee (Base Fee, which is burned) and an optional priority tip (Priority Fee, which goes to validators).

Why do gas fees fluctuate so sharply?

The main reason is network congestion. When many users submit transactions simultaneously, demand for the limited space in a block rises, the gas price goes up, and with it the total bill. The amount of work itself may not have changed at all: what becomes more expensive is simply the rate per unit of gas.

What is the difference between Gas Limit, Gas Used, and Gas Price?

Gas Limit is the ceiling you set in advance for a transaction. Gas Used is how much gas was actually consumed during execution, usually less than or equal to the limit. Gas Price is the price you are willing to pay per unit of gas, expressed in Gwei on Ethereum. The final fee is determined by Gas Used and Gas Price together.

How do Layer 2 solutions reduce gas fees?

Layer 2 solutions like Arbitrum and Optimism collect many transactions into a single batch and process them all at once, spreading the cost across hundreds of users. This sharply lowers the price for each individual, but it comes with its own trade-offs: additional trust assumptions or a shift toward less decentralization.

Put this to work in the terminal

Live charts, derivatives, on-chain and macro data, free.

Open terminal →