What do blockchain networks and your car have in common? They both require gas!

Okay — I know, not the best joke. But if you’ve ever used any blockchain (Metamask, not the exchange kind), you know you have to pay something called a gas fee for every action. Be it receiving or sending your favorite shitcoin or minting an NFT, your transaction is only valid if you approve the network fees for it.

With that comes the million-dollar question: why the heck do peer to peer networks like the blockchain need to charge expensive fees to make it work?

In this article, we'll discuss why gas fees exist, what makes them go up and down and how to minimize gas fees so you can get a bit more bang for your buck. We'll use Ethereum—one of the earliest blockchains to use gas fees, but the concepts discussed apply to most other blockchains.

What is gas, and what are gas fees?

You can think of gas as the transaction fee that needs to be paid in order to get a transaction processed on a blockchain network. And by "transaction," we don't just mean sending crypto to a friend.

Gas is required for pretty much everything you can do on a blockchain that modifies the blockchain's state (i.e. needs to be recorded on the blockchain), whether it be publishing a new smart contract or minting a non-fungible token (NFT).

The gas fee you pay in order to get your transaction processed is used to compensate miners (individuals and organizations that provide the computing power needed to validate blockchain transactions) for the computing power they provide. The amount of gas you need for a transaction is proportional to the computational effort required to process the transaction.

And on most blockchains, including Ethereum, Avalanche, and Ripple, at least a portion of the tokens used as gas are destroyed. This is why gas exists in the first place, to make it prohibitively expensive for malicious actors to overload a network.

Gas is usually denominated in the native currency of the blockchain network. For instance, on the Ethereum blockchain, each unit of gas (called gwei), is equal to one-billionth of an Ether (ETH). Some other blockchains, like Avalanche, also refer to their gas units as gwei.

How do gas fees work?

Now that you understand what gas is, it's time to learn how it works—how much should you use?

As stated earlier, the amount of gas required for a transaction scales up or down depending on the complexity of the transaction. So, for example, publishing a new smart contract would typically be cheaper than just sending some ETH to a friend. The standard transaction fee for Ethereum transactions is 21,000 gwei.

A user is completely free to choose the amount of gas they wish to pay for a transaction (above a base amount, actually). But this does not mean you should not set your gas price too low, as this could result in your transaction being processed very late, or not being processed at all—you can’t take a trip on an empty tank, can you?

Additionally, transactions are usually submitted with a gas limit— the maximum amount of gas that can be consumed in a transaction. This prevent users from overpaying for transactions (gas fees can change even after a transaction has been sent)..

Why are gas fees so high?

Gas prices, just like gasoline prices, go up or down based on a number of factors. It is helpful to have an understanding of what affects gas prices so you can understand just how to go about minimizing those pesky fees!

The primary factor that affects how much gas you need to use in order to have your transaction processed quickly at any given time on a blockchain network is how much activity that blockchain is seeing.

The more gas you're willing to use (i.e., the more you're willing to pay), the greater the chances that a miner would be willing to verify it (since they earn more for doing so).

Since users who seek to transact can set their gas fees, and miners can refuse to verify a transaction if its gas fees are too low, it follows that the more users are looking to transact at any given time, the higher the gas fees will be.

They will bid up the gas fees by offering a higher and higher priority fee, or "tip" to miners in a bid to get their own transactions validated first. This is actually where the entire concept of “gas wars” comes from where multiple people want to mint a specific NFT or buy a coin at the launch. Subsequently, network activity shoots up the roof and the outbidding takes a nasty turn, resulting in super high gas prices.

So, to sum up: When many transactions need to be processed, gas fee goes up. Less transactions = less fees.

How to minimize gas fees

No one really enjoys paying for gas—fortunately, much like with your car, there are a few clever ways you can reduce the amount you spend on gas while still getting your transactions sent through! Most of them are pretty simple to follow and don't require much technical know-how, so let's jump right in.

Timing transactions

When it comes to gas fees, timing is everything. One of the easiest and most popular ways to reduce gas fees is to perform transactions when network activity is low. As established earlier, gas fees decline when there's little network activity.

There are a number of free tools you can utilize to this end. Some good ones are the charts provided by Ethereumprice.org. With Ethereumprice's charts, you can view gas fees on different days and even at different times of the day to find out when transactions might cost less. The time is even set to your local timezone, so they're very convenient to use.

Batching transactions

As earlier mentioned, gas fees vary depending on the type of transaction, with more complex transactions demanding higher gas fees. So it makes sense to batch similar transactions to save on gas fees. Like how it makes more sense to just stock your fridge rather than take countless trips to the grocery store. A good example of this is bulk-minting NFTs rather than minting them one after the other, which often saves a ton of gas.

Using sidechains

Sidechains are blockchain networks built on top of an existing network—they're like blockchain sidekicks. They run alongside the main network but are linked to it. Sidechains typically allow you to carry out most of the same transactions as you would on a blockchain, but faster and for less gas. A good example is the Ethereum sidechain Polygon, which has gained popularity for its cheap, speedy transactions.

Calculating gas fees beforehand

Another thing that might be helpful in saving on gas fees is figuring out how much you're likely to pay before sending a transaction. Note that you can't accurately estimate the amount of gas you'll pay for a transaction as network congestion is dynamic, and thus the gas required for a transaction might change even after it's been sent. However, there are tools that can help you get a good estimate.

One of these tools is, well, your wallet. The wallet you use—whether Metamask, Trust Wallet, or others—probably has an in-built tool that displays the gas price you'll likely need to pay for a transaction.

Instead of your wallet's in-built tracker, you may use specialized ones like Etherscan's gas tracker or Gas Now, which typically offer better estimates than your wallet.

We hope this guide has been useful in helping you understand what gas fees are and how to get your transactions moving quickly with as little gas as possible. Happy transacting!

If you enjoyed this piece, the credit goes to Yusuf! He is a professional writer at Spiritwish.co. He's also a programmer who loves to build stuff and write about it.  A long-time cryptocurrency enthusiast, he's usually tinkering with one protocol or the other, or coding up something fun.