How to Calculate Fees on Bitcoin and EVM
author By Admin
calendar 2026-05-21

How to Calculate Fees on Bitcoin and EVM

Fees are the invisible tax on every on-chain action. Get them wrong and your transaction either stalls for hours or costs far more than it should. Understanding how each network prices transactions — and how to fetch live rates — puts you in full control.

Bitcoin Fees: Pay for Space, Not Computation

Bitcoin fees are priced by transaction size in virtual bytes (vBytes). The fee rate — expressed in satoshis per vByte (sat/vByte) — is driven entirely by mempool demand. A typical single-input, single-output Taproot transaction is ~111 vBytes; a Legacy equivalent can exceed 190 vBytes for the same transfer, costing significantly more at the same fee rate.

Tx Size
(vBytes)
Inputs + Outputs + overhead
Fee Rate
(sat/vByte)
set by mempool demand
×
Total Fee
(satoshis)
paid to miner

Fee = Tx Size (vBytes) x Fee Rate (sat/vByte)

Diagram: Bitcoin Fee Calculation

Address TypeTypical Input SizeRelative Cost
Legacy (P2PKH)~148 vBytesHighest
SegWit-wrapped (P2SH)~91 vBytesMedium
Native SegWit (bech32)~68 vBytesLow
Taproot (bech32m)~57.5 vBytesLowest

Live Fee Rate Tiers (Bitcoin)

Fee rates fluctuate constantly with mempool congestion. Wallets and apps should always fetch live rates from mempool.space and offer three priority tiers to the user:

PriorityFee RateConfirmation Time
Low Priority1-5 sat/vByteHours to days
Medium Priority6-20 sat/vByteNext 1-3 blocks
High Priority21+ sat/vByteNext block

Typical fee rate ranges — always fetch live data from mempool.space

Diagram: Bitcoin Fee Priority Tiers

Fetching Live Bitcoin Fee Rates

Use the mempool.space public API — no API key required:

GET https://mempool.space/api/v1/fees/recommended

Response:

{ "fastestFee": 24, "halfHourFee": 14, "hourFee": 8, "economyFee": 3, "minimumFee": 1 }
PriorityAPI FieldUse Case
High PriorityfastestFeeUrgent sends, time-sensitive payments
Medium PriorityhalfHourFeeStandard sends — best cost/speed tradeoff
Low PriorityeconomyFeeNon-urgent; acceptable to wait hours

Key takeaway: Multiply the chosen fee rate by estimated vBytes to show the user an exact fee before they sign. Cache the response for no more than 30 seconds — mempool rates shift quickly during congestion.

EVM Fees: Pay for Computation, Not Size

On Ethereum and all EVM-compatible chains, fees are priced by gas — a unit of computational effort. Since EIP-1559, Gas Price is split into a Base Fee (burned by the network) and a Priority Fee tip paid to the validator. Wallets expose a Max Fee cap; any surplus is refunded. A plain ETH transfer always costs exactly 21,000 gas.

Gas Used (units)Gas Price (Gwei)ETH Fee (paid)
Base Fee (burned)Priority Fee (to validator)

Fee = Gas Used x (Base Fee + Priority Fee)

Diagram: EVM Fee Calculation (EIP-1559)

OperationGas Used (approx.)
ETH transfer21,000
ERC-20 transfer~65,000
Uniswap swap~150,000
NFT mint~100,000 – 300,000
Complex DeFi operation500,000+

Live Fee Rate Tiers (EVM)

You only control the Priority Fee (tip) — the Base Fee is set automatically by the network each block. Fetch live values via the Ethereum JSON-RPC or a provider like Etherscan:

PriorityPriority FeeConfirmation Time
Low Priority1-2 Gwei tipMinutes to hours
Medium Priority2-5 Gwei tipNext few blocks
High Priority10+ Gwei tipNext block

Priority Fee (tip) only — Base Fee is set by the network automatically

Diagram: EVM Fee Priority Tiers

Fetching Live EVM Fee Data

Fetch current Base Fee directly from the node:

eth_gasPrice // legacy — returns current gas price in Wei eth_feeHistory(4, "latest", [25,50,75]) // EIP-1559 — returns base fee + priority percentiles

Or use the Etherscan Gas Oracle API:

GET https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=YourKey
PriorityPriority Fee (tip)Expected Confirmation
High Priority10+ GweiNext block (~12 sec)
Medium Priority2–5 GweiNext few blocks
Low Priority1–2 GweiMinutes to hours

Key takeaway: Always call eth_estimateGas before sending — never hardcode gas limits except for plain ETH transfers. Add a 20% buffer to the estimate to protect against mid-execution state changes.

Fee estimation is not a detail — it's a core part of every transaction. Underpay on Bitcoin and your transaction sits unconfirmed for hours. Underpay on EVM and it reverts, costing gas with nothing to show for it. Fetch live rates, respect the priority tiers, and your transactions land cleanly every time.

Which chain's fee model do you find more intuitive — Bitcoin's size-based approach or EVM's gas model? Let us know below.

Share: