Sub topic 9
What Network Fees Pay For
This chapter assumes you know what a blockchain transaction is, can read basis points (1 bp = 0.01%), and have seen an exchange's withdrawal screen. The Python snippet is optional. The chapter covers who receives a network fee, what it buys, and why it behaves differently from an exchange fee. Later chapters cover how the price is set (fee markets) and the Bitcoin and EVM formulas in detail.
The one-sentence model
A network fee (also called an on-chain fee) is what the sender pays for a share of limited space in a block. Block producers need that space to record transactions. The fee does not pay the exchange, the wallet app, or the recipient.
Two consequences follow:
- The fee depends on how much work your transaction asks the network to do, not on how much money you move.
- You pay it only for on-chain activity. A transfer between two accounts on the same exchange usually changes a database row and touches no blockchain, so it normally has no network fee.
What the fee buys
Block space is scarce. Each block has a size or computation cap, and every full node must store and verify what goes into it. The fee pays for three things.
- Inclusion. A producer (a miner on Bitcoin, a validator on Ethereum) picks your transaction over others waiting in the mempool, the pool of unconfirmed transactions.
- Spam resistance. If transactions were free, an attacker could fill blocks with junk. A price per unit of space makes that expensive.
- Security funding. Producers earn block rewards plus fees. Fees become a larger share of that income as issuance shrinks, so they help pay for the cost of attacking the chain.
Not every fee reaches a producer. On Ethereum, the base fee part is burned (destroyed). Only the priority fee, often called the tip, goes to the validator.
Fee follows resource use, not value
Fees are charged per unit of resource. On Bitcoin the resource is virtual size (vsize, a measure of how many bytes the transaction takes in a block). On EVM chains it is gas, a unit of computation and storage work. A transaction moving $10 and one moving $10 million cost the same if they use the same resources.
The next snippet reuses the EVM fee formula and shows what that does to the fee as a share of the amount sent.
GWEI = 10**9
WEI_PER_ETH = 10**18
def evm_fee_eth(gas_used, base_fee_gwei, priority_fee_gwei, max_fee_gwei):
gas_price_gwei = min(max_fee_gwei, base_fee_gwei + priority_fee_gwei)
return gas_used * gas_price_gwei * GWEI / WEI_PER_ETH
gas_used = 21_000 # a plain ETH transfer
fee = evm_fee_eth(gas_used, base_fee_gwei=20, priority_fee_gwei=2, max_fee_gwei=50)
burned = gas_used * 20 * GWEI / WEI_PER_ETH # base fee part
tip = fee - burned # priority fee part
print(f"total {fee:.6f} ETH, burned {burned:.6f}, to validator {tip:.6f}")
for amount in (0.01, 1, 1000):
bps = fee / amount * 10_000
print(f"{amount:>7} ETH sent -> fee is {bps:.3f} bps of the amount")The output shows a total of 0.000462 ETH, of which 0.00042 is burned and 0.000042 goes to the validator. The same fee is 462 bps of a 0.01 ETH transfer and about 0.005 bps of a 1,000 ETH transfer. A flat per-transaction cost is painful for small amounts and negligible for large ones, which is the opposite of a percentage trading fee.
Bitcoin works the same way. A typical 141 vB transaction at 10 sat/vB costs 1,410 satoshis whether it moves 100,000 sats (1.41%, or 141 bps) or 100,000,000 sats (0.00141 BTC of fee on 1 BTC, or 1.41 bps).
How network fees differ from exchange fees
| Property | Exchange trading fee | Network fee |
|---|---|---|
| Paid to | The exchange | Block producers, plus a burn on some chains |
| Scales with | Order value (a rate in bps) | Resources used (vsize or gas) |
| Set by | The exchange's schedule and your tier | Auction among users for block space |
| Varies over time | Rarely, only by tier or policy change | Minute to minute with demand |
| Paid in | Usually the quote currency or a fee token | Always the chain's native coin |
The last row matters in practice. To move an ERC-20 token you still need ETH (or the chain's native coin) in the sending wallet for gas. A wallet holding only the token cannot send it.
Common errors and edge cases
- Failed transactions still cost money. On EVM chains, if a contract call runs out of gas or reverts, the work done before the failure was real. You pay for the gas consumed, and you get nothing for it. Bitcoin transactions either confirm or stay unconfirmed, and an unconfirmed one costs nothing.
- Gas used is not gas limit. You set a gas limit as a ceiling, but you pay only for gas actually used. A plain transfer uses exactly 21,000. Contract interactions use far more, and swaps or token approvals can use several times that.
- Max fee is a cap, not the price. On EVM chains,
max_feebounds what you could pay. The effective price ismin(max_fee, base_fee + priority_fee), as in the code above. Setting a high cap does not mean paying it. - Too low a fee leaves the transaction pending. Producers fill blocks with the best-paying transactions first. A low-fee transaction can wait hours or be dropped from mempools. Replacing it with a higher-fee version (RBF on Bitcoin, same nonce on EVM) is the usual fix, and you should not send a second, separate transaction.
- Wrong network, lost funds. The same token can exist on several chains, each with its own fees and addresses. Sending to an address on a chain the recipient does not support can lose the funds permanently, and the fee is spent either way.
- Layer 2 fees have two parts. Rollups and similar chains charge for their own execution plus the cost of posting data to the base chain. The second part moves with base-chain conditions even when the layer 2 itself is quiet.
- Fee estimators are forecasts. Wallets estimate from recent blocks. During a sudden demand spike, an estimate that was right a minute ago can leave you underpriced.
Putting it together
A network fee is a payment for block space, priced by resource use and by competing demand, and paid in the native coin by whoever signs the transaction. When you estimate a trade's total cost later in this tutorial, you will treat it as a roughly fixed amount per on-chain action. You will then ask how many on-chain actions the plan needs: one deposit, one withdrawal, or several hops across chains.
Exercise
You send two Bitcoin transactions, each about 141 vB, at 10 sat/vB. One moves 0.001 BTC (100,000 sats) and the other moves 0.1 BTC (10,000,000 sats). What is the fee for each, and what is each fee as basis points of the amount sent? What does this tell you about when network fees matter most?
Show answer
Both fees are 141 × 10 = 1,410 sats because the fee depends on size and rate, not on value. For the 100,000-sat transfer, 1,410 / 100,000 × 10,000 = 141 bps. For the 10,000,000-sat transfer, 1,410 / 10,000,000 × 10,000 = 1.41 bps. Network fees matter most for small transfers, where the flat cost is a large share of the amount. They are almost negligible for large ones.
Exercise
An EVM transaction uses 21,000 gas. The base fee is 30 gwei, the priority fee is 3 gwei, and the sender's max fee is 40 gwei. What is the total fee in ETH, and how much of it is burned?
Show answer
The effective gas price is min(40, 30 + 3) = 33 gwei. Total fee = 21,000 × 33 gwei = 693,000 gwei = 0.000693 ETH. The burned part is the base fee portion: 21,000 × 30 gwei = 630,000 gwei = 0.00063 ETH. The remaining 0.000063 ETH goes to the validator as the priority fee.