Crypto glossary

Gas

Gas is the unit a blockchain such as Ethereum uses to measure how much computation a transaction or smart-contract call needs. You pay for that gas in the network's coin, so gas is both a measure of work and the basis of the fee.

Auf Deutsch lesen

Gas as a meter for computation

Every operation on a smart-contract blockchain, from adding two numbers to storing data, has a fixed gas cost. A plain ETH transfer uses 21,000 gas; a token swap or an NFT mint runs much more code and uses more. Gas exists so that nobody can make thousands of computers run endless code for free: every step has a price.

The fee is gas used multiplied by the price per unit of gas. On Ethereum that price is quoted in gwei, a billionth of one ETH. Since the London upgrade in August 2021 (EIP-1559), the price has two parts: a base fee set by the protocol according to demand, which is burned, and an optional priority fee, or tip, that goes to the validator who includes your transaction.

A worked example

Say you send ETH to a friend while the base fee is 18 gwei and you add a 2 gwei tip. The transfer uses 21,000 gas, so the fee is 21,000 × 20 gwei = 420,000 gwei, or 0.00042 ETH. A swap that uses 150,000 gas at the same price would cost seven times more, roughly 0.003 ETH. What that is in dollars depends on the ETH price at that moment.

Gas limit and failed transactions

Your wallet also sets a gas limit: the most gas you allow the transaction to use. If the code needs more than that, it runs out of gas, reverts, and none of its effects happen. The gas already spent is still charged, because validators did the work. This is why a failed transaction on a busy day can cost a noticeable fee and give you nothing.

Why gas prices move

Block space is limited. When many people want to transact at once, during a market crash, a popular mint or a token launch, the base fee rises block by block until demand cools. Layer 2 networks bundle many transactions together and post them to Ethereum, which is why the same action there usually costs a fraction of the mainnet fee.

Ask Coach about it

Coach is the AI on AtenaCrypto. It explains crypto with live market data, in plain words.

How is the gas fee for an Ethereum transaction calculated, and how can I avoid paying for failed transactions?Ask Coach →

Frequently asked questions

Why do I need ETH to send a token?

Gas on Ethereum is paid in ETH, not in the token you are sending. If your wallet holds USDC but no ETH, you cannot move the USDC until you add a little ETH for gas.

Does Bitcoin have gas?

No. Bitcoin fees are based on the size of a transaction in bytes, not on computation, because Bitcoin scripts are deliberately simple. The word gas is used on Ethereum and chains built like it.

Can I get gas back from a failed transaction?

No. The gas consumed up to the point of failure is kept by the network and the validator. Only unused gas above what was consumed is never charged in the first place.

Related terms

Gas FeeBase FeePriority FeeGas LimitSmart ContractLayer 2 (L2)

Learn it step by step

AC Learning explains these ideas in interactive lessons — the first eight sections are free.

Open AC Learning → Create a free account

All glossary terms · Educational reference only — not investment, legal, tax or financial advice.