Glossary

Gas Price

Gas price is the amount of cryptocurrency a user pays per unit of computation on blockchains like Ethereum, measured in gwei.

Key Takeaways

  • Gas price is the per-unit cost of computation on Ethereum and EVM-compatible chains, measured in gwei (1 gwei = 0.000000001 ETH). Total gas fees equal gas used multiplied by the gas price.
  • Since the London hard fork (August 2021), Ethereum uses the EIP-1559 fee model: a dynamic base fee that adjusts with demand plus an optional priority tip. The base fee is burned, making the old first-price auction model obsolete.
  • Gas-based pricing differs fundamentally from Bitcoin's fee estimation model, which charges per data byte rather than per computation. This distinction matters for Bitcoin users bridging into EVM-compatible Layer 2s or transacting with stablecoins on Ethereum.

What Is Gas Price?

Gas price is the amount a user pays per unit of gas on Ethereum or any EVM-compatible blockchain. Every operation the Ethereum Virtual Machine executes: storing data, transferring tokens, interacting with a smart contract: consumes a specific quantity of gas. The gas price determines how much that computation costs in real terms.

Think of gas as a metering system for blockchain computation. Just as an electricity meter measures kilowatt-hours, the EVM meters each operation in gas units. The gas price is the rate you pay per unit, denominated in gwei (gigawei). One gwei equals one billionth of an ETH (10⁻⁹ ETH), so even when gas prices reach tens of gwei, individual operations cost fractions of a cent.

The total gas fee for any transaction follows a straightforward formula:

Total fee = gas used × gas price

Example: a simple ETH transfer
  Gas used:  21,000 units (fixed)
  Gas price: 10 gwei
  Total fee: 21,000 × 10 gwei = 210,000 gwei = 0.00021 ETH

How It Works

Each EVM opcode has a fixed gas cost. A simple addition (ADD) costs 3 gas. Storing a 32-byte value to contract storage (SSTORE) costs 20,000 gas for a fresh slot. Every transaction starts with an intrinsic cost of 21,000 gas just to be valid, before any contract logic executes. These fixed costs ensure that computationally expensive operations pay proportionally more.

Common Operation Costs

OperationGas UnitsNotes
Simple ETH transfer21,000Fixed intrinsic cost
ERC-20 token transfer~50,000–65,000Varies by token contract
ERC-20 approval~45,000Required before DeFi interactions
Uniswap swap~150,000–300,000Depends on route complexity
Contract deployment32,000+ executionHighly variable by contract size

Users set a gas limit on each transaction: the maximum gas they are willing to consume. If execution finishes under the limit, unused gas is refunded. If the transaction runs out of gas mid-execution, it reverts, but the gas already consumed is still charged.

The Pre-EIP-1559 Auction Model

Before August 2021, Ethereum used a first-price auction for gas. Users bid a single gas price, and miners prioritized transactions with the highest bids. This created several problems: users routinely overpaid to ensure inclusion, fee estimation was unreliable, and sudden demand spikes caused dramatic price jumps.

EIP-1559: Base Fee + Priority Tip

The London hard fork (August 5, 2021) introduced EIP-1559, replacing the auction with a two-component fee structure:

  • Base fee: an algorithmically determined per-gas price that every transaction in a block must pay. This portion is burned (permanently removed from ETH supply).
  • Priority fee (tip): an optional per-gas incentive paid directly to the block proposer. During normal conditions, 1–2 gwei is sufficient.

The base fee adjusts automatically based on block utilization. Each block targets 50% capacity. When a block exceeds the target, the base fee increases by up to 12.5%. When a block is under the target, it decreases by up to 12.5%. This creates predictable fee dynamics: if blocks are consistently full, the base fee rises exponentially until demand falls.

// EIP-1559 transaction parameters
{
  maxFeePerGas: 20,          // gwei - absolute maximum per gas unit
  maxPriorityFeePerGas: 2,   // gwei - tip for the validator
  gasLimit: 21000             // max gas units to consume
}

// Actual cost calculation
effectiveGasPrice = min(maxFeePerGas, baseFee + maxPriorityFeePerGas)
totalFee          = gasUsed × effectiveGasPrice
burned            = gasUsed × baseFee
validatorTip      = gasUsed × (effectiveGasPrice - baseFee)
refund            = (maxFeePerGas - effectiveGasPrice) × gasUsed

This model benefits users in two ways. First, fee estimation becomes more predictable because the base fee is publicly known before submission. Second, users who set a generous maxFeePerGas automatically receive a refund for the difference if the actual base fee is lower.

How Gas Prices Fluctuate

Gas prices reflect real-time demand for block space. During high-activity events (NFT mints, token launches, market volatility), base fees can spike from single-digit gwei to hundreds of gwei within minutes. In September 2020, average gas prices exceeded 480 gwei during DeFi summer. By mid-2026, average gas prices have fallen to under 1 gwei, driven by Layer 2 adoption and block gas limit increases from 30 million to 60 million.

Gas Price vs. Bitcoin Fees

Bitcoin and Ethereum use fundamentally different models for transaction pricing. Understanding the distinction is important for Bitcoin users who interact with EVM-compatible chains for stablecoin payment rails or cross-chain transactions.

AspectEthereum (Gas Price)Bitcoin (Fee Rate)
UnitGwei per gas unitSatoshis per virtual byte
What is pricedComputational workTransaction data size
Fee mechanismBase fee (burned) + tipFirst-price auction
Complexity pricingEach opcode has a different gas costAll bytes priced equally (witness discount only)
Refund mechanismUnused gas refundedNo refund (fee is fixed at broadcast)
Fee burningBase fee burnedAll fees go to miners

Bitcoin's model is simpler: fees depend on transaction size in virtual bytes, not computational complexity. A Bitcoin transaction with two inputs and two outputs costs the same fee regardless of whether it sends 0.001 BTC or 1,000 BTC. On Ethereum, a simple transfer costs 21,000 gas, but interacting with a complex DeFi contract can cost 10x or more.

Bitcoin wallets estimate fees by analyzing the mempool state and predicting which fee rate will achieve confirmation within a target number of blocks. This estimation relies on historical block data and current mempool depth. Ethereum wallets can simply read the current base fee from the latest block header, making short-term fee prediction more deterministic.

Use Cases

DeFi Transaction Planning

Gas prices directly affect the economics of decentralized finance. A swap on a DEX that costs 200,000 gas becomes prohibitively expensive at 100 gwei (0.02 ETH) but trivial at 1 gwei (0.0002 ETH). Traders often time their transactions for low-activity periods (weekends, off-peak hours) to minimize gas costs, or use gas tracking tools to set optimal maxFeePerGas values.

Layer 2 Fee Optimization

Layer 2 rollups have a two-part fee structure: an L2 execution cost (very cheap) plus an L1 data posting cost (the dominant expense). The introduction of blob transactions via EIP-4844 (March 2024) reduced L2 data costs by 10–100x by creating a separate fee market for temporary data blobs rather than using expensive permanent calldata.

For Bitcoin users exploring stablecoin payments on EVM-compatible chains, Layer 2s offer significantly lower gas prices. A USDC transfer on Ethereum mainnet might cost $0.50–$5.00 depending on gas prices, while the same transfer on an L2 rollup can cost under $0.01.

Smart Contract Gas Optimization

Developers writing smart contracts must consider gas costs in their design. Every storage write, loop iteration, and function call consumes gas that users pay for. Common optimization techniques include packing multiple variables into single storage slots, minimizing on-chain storage, and using events instead of storage for data that only needs to be read off-chain.

Why It Matters for Bitcoin Users

Gas pricing becomes directly relevant to Bitcoin users in several scenarios. Moving stablecoins on Ethereum or EVM-compatible chains requires understanding gas costs to avoid overpaying. Bridging Bitcoin to wrapped representations on EVM chains involves gas-priced transactions on both sides. And as Bitcoin Layer 2s adopt EVM compatibility, gas-based fee models may become part of the Bitcoin ecosystem itself.

Spark approaches this differently by operating as a Bitcoin-native Layer 2 that does not use gas-based pricing. Transactions on Spark follow Bitcoin's UTXO model rather than the account-based model that gas pricing was designed for, offering a familiar fee structure for Bitcoin users.

Risks and Considerations

Fee Volatility

Gas prices can change dramatically in seconds. A transaction submitted at 5 gwei might be underpriced minutes later if a popular NFT mint or token launch floods the mempool. While EIP-1559 made fees more predictable compared to the old auction model, short-term spikes can still catch users off guard. Setting a conservative maxFeePerGas protects against spikes while the refund mechanism ensures users do not overpay.

Failed Transactions Still Cost Gas

If a transaction runs out of gas or reverts due to a smart contract error, the gas consumed up to the point of failure is still charged. Users pay for the computation even though the transaction produced no useful result. This is a key difference from Bitcoin, where invalid transactions are simply rejected by the mempool without any fee.

MEV and Priority Fee Manipulation

Maximal extractable value (MEV) creates scenarios where sophisticated actors manipulate gas prices for profit. Sandwich attacks, front-running, and back-running all exploit the priority fee mechanism to reorder transactions within a block. Users interacting with DeFi protocols should be aware that their transactions may be reordered by validators or MEV searchers regardless of the gas price they set.

Cross-Chain Fee Confusion

Users moving between Bitcoin and Ethereum ecosystems often struggle with the different fee models. Bitcoin's sat/vB rate and Ethereum's gwei-per-gas price are not directly comparable. A "low" gas price on Ethereum can still result in a high total fee if the transaction is computationally expensive, while Bitcoin fees depend purely on transaction size. Understanding both models is essential for anyone operating across chains.

This glossary entry is for informational purposes only and does not constitute financial or investment advice. Always do your own research before using any protocol or technology.