Fundamentals: What are gas fees?
A quick explainer on gas fees.
Gas fees are an inescapable part of interacting with blockchains. Put simply, they are the transaction fees one pays when before making a transaction on a blockchain, like buying an NFT or trading on a decentralized exchange (DEX). Primarily, gas fees apply to blockchains that rely on smart contracts, like Ethereum, and the price of gas fees can vary based on factors including the current activity on that blockchain or the specific smart contract you are interacting with.
How do gas fees work?
“Gas” is a unit that essentially measures how much computational work is required to execute a specific action on a blockchain. Different transactions can have different levels of complexity, which can impact how much gas that transaction might consume.
Typically, gas fees are denominated in the native token of that blockchain, so paying gas fees on Ethereum, for example, requires that you have enough ETH in your wallet to do so. On Ethereum, which can process about 30 transactions per second, gas fees can often spike during times of heavy activity, such as NFT drops, to as high as hundreds, or even thousands of dollars. On other blockchains, though, like Avalanche for example, gas fees can be as low as pennies (or less).
When trading on a DEX, users must pay gas fees for both approvals and swaps. The first time a user sells a new token from their wallet, they must perform a one-time transaction to set an approval for it. This transaction costs gas. Users also need to main token balances to pay gas fees on every subsequent transaction.
Why are gas fees important?
Gas fees serve a critical role in the functioning of sufficiently decentralized blockchains. Blockchains typically rely on a network of validators, which are computers running specialized open source code that verify transactions and help ensure the security of that chain. Gas fees are paid out to these validators, essentially as an incentive to efficiently and honestly process transactions. Since some blockchains have limited capability to process transactions, gas fees help validators prioritize which transactions are processed first, based on the size of the gas fee being paid.
Gas fees also incentivize validators to continue minings blocks and investing in their computing resources, which overall helps to ensure that the network is secure. Without a sufficient number of validators incentivized to continue operating, the network would be at higher risk of being compromised by malicious actors.