Gas fees are a completely new concept for most of us. And it can be confusing, particularly when we’re just trying to wrap our heads around how blockchain works.
So, what are gas fees?
Gas fees are essentially the cost of using the blockchain network for users. Every time you want to interact with a smart contract – whether that’s to send a transaction- like sending some cryptocurrency to a friend, or execute a function – you need to pay gas fees.
Every price for a good or service considers a variety of factors to determine the final price. Let’s look at a bus ticket in New York City for example. The fare price is not only the cost to get the bus from point A to point B, but also the operational costs that go into running the bus service. The city has to pay the employees that drive the buses, fill up the gas tank, and maintain the buses. The bus ticket price goes to support the overall system.
Gas fees work much like this. They go to the compensation for the energy required by computers to verify and validate transactions on the network, and the overall system. The individuals or groups that own these computers with the specific purpose of having them work on a given blockchain network are called miners.
Mining is a computationally-intensive process that requires enormous amounts of energy. So, gas fees are designed to cover the cost of the electricity consumed by the miners when they process transactions.
What determines gas fees?
A gas fee is determined by two things: the gas limit and the gas price.
– the gas limit: is set by the sender and represents the maximum amount they’re willing to spend on a transaction.
– the gas price: is set by the miners and represents the amount they’re willing to charge per unit of energy for the transaction.
The total gas fee is then calculated by multiplying the gas limit by the gas price.
The gas fee amount is set by the sender because they’re the ones requesting to have their transaction processed by the network. Generally, if you set a low gas fee, your transaction will take longer to confirm – but it will be cheaper. If you set a high gas fee, your transaction will confirm more quickly – but it will be more expensive.
It’s important to remember that gas fees are not paid to any one specific person – they go into a pool that’s shared by all the miners who process transactions on the network.
One of the great things about gas fees is that they provide an incentive for people to keep the network running smoothly. By paying gas fees, we’re effectively paying people to keep the network running. And that’s something that we all benefit from.