๐Ÿ“Š Base Fee + Priority Fee = Total Gas Cost

Understand EIP-1559 and how the new fee mechanism works

โ†
Previous
Introduction

โš™๏ธ How Gas Works

Gas fees are calculated using a formula: (Base Fee + Priority Fee) ร— Gas Used. Let's break it down with an interactive calculator.

๐Ÿงฎ Interactive: Gas Fee Calculator

Adjust the sliders to see how gas fees change in real-time:

50 gwei
Low (10)High (200)
2 gwei
No Tip (0)Urgent (20)
21,000
Simple Transfer (21K)Complex Contract (500K)
Total Transaction Cost
0.001092 ETH
โ‰ˆ $2.73 USD
Base Fee (Burned)
0.001050 ETH
$2.63
Priority Fee (Tip)
0.000042 ETH
$0.10
Total Fee
1,092,000 gwei
21,000 gas used

EIP-1559: The Fee Market Reform

Before August 2021, gas fees used a simple auction modelโ€”highest bidder wins. EIP-1559 introduced a dynamic base fee that adjusts automatically based on network demand.

๐Ÿ“Š
Dynamic Base Fee

Adjusts by ยฑ12.5% per block based on congestion. If blocks are greater than 50% full, base fee increases; if less than 50% full, it decreases.

Block 50% full โ†’ No change
Block 100% full โ†’ +12.5%
Block 0% full โ†’ -12.5%
๐Ÿ”ฅ
Fee Burning

Base fees are burned (destroyed), reducing ETH supply. During high usage, more ETH is burned than created, making ETH deflationary.

High usage โ†’ Burns exceed issuance
Result โ†’ Net negative ETH supply
Effect โ†’ Potential price increase

โšก Real-World Transaction Types

๐Ÿ’ธ
Simple ETH Transfer
21,000 gas
Fixed gas cost. At 50 gwei: 0.00105 ETH (~$2.63)
๐Ÿ”„
Token Transfer (ERC-20)
~65,000 gas
More complex. At 50 gwei: 0.00325 ETH (~$8.13)
๐ŸŽจ
NFT Mint
~100,000 gas
Storage-intensive. At 50 gwei: 0.005 ETH (~$12.50)
๐ŸŒŠ
Uniswap Swap
~150,000 gas
Multiple contract calls. At 50 gwei: 0.0075 ETH (~$18.75)

๐Ÿ’ก Key Insight: Gas Limit vs Gas Used

The gas limit is the maximum you authorize, like a spending cap. The gas used is what actually gets consumed. Unused gas is refunded!

You set: Gas Limit = 100,000 (max authorization)
Transaction uses: Gas Used = 65,000 (actual consumption)
โœ“ Refunded: 35,000 gas back to you