Skip to content

What Is a Gas Fee? The Cost of an On-Chain Action, Explained

Share
Two identical smoked-glass slabs beside a short and a much taller price bar, orange at its tip: PRICE OF WORK

You press send, and before anything happens your wallet shows one more line: a network fee. It is easy to treat that line as noise. It is not. It is the price of asking a public network to do work for you, and it follows rules you can learn.

On networks that run smart contracts, that price is usually called gas. The name is a metaphor. An action needs fuel to run, and the more work it asks of the network, the more fuel it burns.

This piece stays vendor-neutral. It explains what a gas fee pays for, how it is calculated, why it rises and falls, and why a failed transaction can still cost you.

It also shows where the fee appears on an explorer page. You do not need to write code to follow it. You need to know what you are paying for, so the number on the screen stops being a surprise.

Key Takeaways

  • A gas fee pays the network for the computation and storage your on-chain action uses, not the app or firm you are using.
  • The fee is the amount of work your action uses, multiplied by the price you pay for each unit of that work.
  • Fees move with demand for block space, with how complex your action is and with the network you choose.
  • A failed transaction can still cost gas, because the network did work before the action stopped.
  • An explorer's transaction page shows the fee, the work used and the status, so you can check what you paid.

What a Gas Fee Is

A blockchain is a shared computer that many independent machines run at once. Every action you send to it, whether a transfer or a call to a smart contract, makes those machines do work. They check your signature, run the code, and update the shared record.

That work is not free. Gas is the unit the network uses to measure it. Each basic operation has a gas cost attached. A simple transfer needs only a little. A contract call that runs many steps and writes new data needs far more. What a contract is, code at its own address that runs only when a transaction calls it, is explained in what a smart contract is.

The gas fee is what turns that measurement into a price. You pay it in the network's own token, and it goes to the parties that process transactions and add them to blocks. The fee pays the network, not the app. The wallet, the exchange interface or the firm you deal with may show you the fee, but in the basic design they are not the ones who collect it.

What You Are Actually Paying For

The fee pays for two kinds of cost. The first is computation: every step the network runs while it executes your action. The second is storage: every piece of data your action writes to the shared record, which every machine on the network has to keep.

Storage tends to be the expensive part. Reading data is cheap, because nothing new has to be kept. Writing new data is costly, because the network carries it from then on. That is why creating a new balance inside a contract, opening a position or deploying a contract is usually the expensive kind of action, while a plain transfer from one wallet to another is the cheap kind.

Two related terms show up in most wallets. The gas limit is the most gas you allow an action to use. The gas used is what it actually consumed. You set the limit as a ceiling, and you pay for what was used, up to that ceiling. If the action needs more than you allowed, it stops.

How the Fee Is Calculated

At its core, the calculation is a single multiplication. You take the gas your action used and multiply it by the price you pay per unit of gas.

Gas fee = gas used × price per unit of gas

The first factor depends on what you do. The second depends on the market for block space at that moment. In many designs, the price per unit has two parts: a base price that the network sets from recent demand, and an optional tip you add to get picked sooner. Your wallet usually fills in both and lets you adjust them. The tip buys an earlier spot, not protection from what others send around your transaction while it waits, as our guide to what MEV is explains.

The example shows the split between the two factors. The work stayed the same. Only the price of work changed. Same action, different moment, different fee. That is the most common reason a fee looks high one day and low the next.

Why Gas Fees Move

Gas fees are not set by a price list. They come out of how much space there is in each block and how many people want it at the same time.

  • Demand for block space. Each block holds only so much work. When many users send at once, they compete for that space, and the price per unit of gas rises.
  • Complexity of the action. An action with more steps and more stored data uses more gas, whatever the price of a unit is.
  • The network you use. Different networks have different capacity and fee designs, so the same kind of action can cost very different amounts on two of them.
  • The token's own price. You pay in the network's token. If that token rises in value, the same fee costs you more in dollar terms.

You control two of these. You choose what you send and where you send it. You can also choose when. A transaction that is not urgent can wait for a quieter moment, and many wallets show you whether the network is busy before you sign.

Why a Failed Transaction Still Costs Gas

This is the part that surprises people most. You send a transaction, it fails, and you still pay a fee.

The reason is simple. The network did work before it found out the action could not finish. It checked the signature, started running the code and spent effort on every step up to the point of failure.

That effort was real, and the machines that did it are paid for it. Failure does not refund the work. The action itself is undone, so no tokens move, but the fee for the work spent stays spent.

There are a few common causes:

  • The gas limit was too low. The action ran out of gas before it finished. Raise the limit and it may succeed.
  • The contract refused the action. A condition in the code was not met, such as a balance that was too small or a price that moved too far.
  • The state changed in the meantime. Another transaction landed first and changed what your action depended on.

Repeated failures add up. If a transaction fails, find out why before you send it again. Read the status and the error on the explorer first. Resending the same thing at a higher fee only buys the same failure sooner.

Layer-Two Networks and the Base Layer

The network where transactions finally settle is often called the base layer, or layer one. Block space there is scarce, so fees can climb when demand is high. Layer-two networks are a way around that.

A layer-two network runs transactions in its own environment and then sends a compressed record of them to the base layer. Many transactions share one entry on the base layer, so each of them pays only a slice of that cost. That is why fees on a layer-two network are usually lower.

The fee does not disappear. It changes shape. On many layer-two designs, your fee has two parts: one for running your action on the layer-two network and one for your share of the data posted to the base layer. When the base layer gets busy, the second part can rise even though nothing changed where you transact.

Some applications go one step further and pay the fee on your behalf. You sign, and someone else submits and pays. That can feel like a free transaction. It is not. The fee still exists. Someone else pays it, and it is fair to ask how they get that money back.

Gas Fees Versus Trading Fees

A gas fee and a trading fee are easy to mix up, because both show up when you act. They are different charges, paid to different parties for different things.

A gas fee is paid to the network for running an on-chain action. A trading fee is charged by a venue for matching your order with someone else's. A venue that runs its own order book can charge trading fees on every fill, whether or not you pay any gas for the same action. Our guide to maker and taker fees explains how that second kind of fee works.

That matters for how you read your own costs. Know which fee you are looking at. A trading fee belongs in your trade review. A gas fee belongs to the on-chain step that carried your action, if there was one.

Where to Find the Fee on an Explorer Page

Every transaction page on a block explorer shows what the sender paid. The field names differ from one explorer to the next, but the same handful of facts appear on most of them. Our guide to what a block explorer is walks through the rest of the page.

FieldWhat it tells you
StatusWhether the action succeeded or failed
Transaction feeThe total the sender paid, in the network's token
Gas limit and gas usedThe ceiling that was set and the work actually consumed
Gas priceThe price per unit of gas, often split into base price and tip

Read the status first. Then compare gas used with the gas limit. If the two are equal and the status says failed, the action most likely ran out of gas. If gas used is well below the limit and it still failed, the contract refused the action for another reason, and the page often shows an error message.

The fee line also tells you something on its own. It is charged to the account that submitted the transaction. When an application pays on your behalf, that account is theirs, not yours.

What This Means When a Firm Says It Is On-Chain

For a prop firm, being on-chain means some of its actions are written to a public record. Each of those writes is a transaction, and each transaction carries a fee and a status you can read. That is what makes the record checkable. It is also why a firm cannot write everything on-chain for free.

A gas fee tells you what an on-chain action cost and who submitted it. It does not tell you whether the action was the right one, whether it followed the firm's rules or whether anything is owed to you. Those questions live in the firm's rules and its disclosures, not in the fee field.

If you want to see which wallets and contracts a firm points to as its on-chain record, start with its own disclosure page. For CarrotFunding, that is the transparency and on-chain proofs page, which lists the wallets, smart contracts and fund flows behind the platform.

Conclusion

A gas fee is not a hidden charge from the app in front of you. It is a payment to the network for the work your action asks it to do, priced by how busy the network is at that moment.

Once you see it that way, the decision in front of you gets clearer. You can change what you send, where you send it and when, but you cannot make the work free. And when a transaction fails, the explorer tells you why before you pay for the same mistake twice.

FAQ

Why do I need the network's own token to pay gas?

The fee is priced in that token, so the network expects it in that token. Holding only a stablecoin is usually not enough to send a transaction, even if you want to move the stablecoin itself. If your balance of the native token is too low, the transaction cannot be sent. Some applications pay the fee for you; then someone else holds the token and pays it. What a stablecoin is, and what keeps it at its reference value, is covered in our guide to stablecoins.

Can I cancel a transaction that is still pending?

Often you can replace it rather than cancel it. In many designs, you send a new transaction with the same sequence number and a higher fee, and the network processes only one of the two. That works only while the first one is still waiting. The replacement is a transaction too, so it costs gas if it lands.

Does a higher gas fee make a transaction safer?

No. A higher fee buys you priority in getting your transaction included, not protection for what it does. The network runs a harmful transaction just as faithfully as a safe one, and a scam costs gas like anything else. Check the address, the amount and what you approve before you sign. The fee says nothing about any of them.

Does signing a message in my wallet cost gas?

Usually not. Signing a message, for example to log in to an application, proves you control an address without sending anything to the network. Nothing is written to the chain, so there is no work to pay for. A wallet will normally show whether a request is a message or a transaction. Read that screen before you sign, because a transaction can move funds.

Why did the fee on the explorer differ from my wallet's estimate?

The wallet estimated before the transaction ran, and the explorer shows what happened when it did. The work used can differ from the forecast, and the price per unit can move between signing and inclusion. In most designs you pay for the work actually used, up to the limit you set, so the final fee is often lower than the worst case your wallet showed.

Contents
Topics

92 articles in total

Ready to trade with our capital?

Pass the evaluation and trade funded on a prop firm built by traders, for traders.

Get Funded

More Insights

Education

What Is MEV? Who Sees Your Transaction Before It Lands

MEV is the value someone can earn by choosing the order of transactions before they land in a block. Here is where your transaction waits, how front-running, sandwiches and back-running work, what changes between pools and order books, and why a public order is not the same as a fair one.

9 min read