Gas is the financial fuel of the Ethereum network. It allows minors to be rewarded for their work validating transactions and executing smart contracts.
Each transaction or instruction of a contract therefore has a cost.
How gas works on Ethereum
How these fees work is a bit more complex on Ethereum than on Bitcoin. Indeed, the user can adjust various parameters which will define the gas cost of his operation.
There are two variables : the price of gas and diesel limit ( price gas and gas limited ).
We can visualize the price of gas like the price of gasoline in a gas station. In this analogy, the gas limit then becomes the capacity of the tank of the vehicle representing the transaction.
The price of gas is set in GWei , a subdivision of ether. The miners therefore receive many ethers as a reward for their work.
Ethereum smart contracts allow you to set up recursive loops. There needs to be a limit to the amount of gas that can be consumed per transaction. If this was not the case, in the event of an infinite loop , the account of the user concerned would be emptied of all its ethers!
Evaluate transaction fees
But then, how to fix these two parameters ? It all depends on the confirmation time you want for your transaction. Like Bitcoin, Ethereum works with an auction system : fees are freely set by users. Minors therefore choose the transactions with the most fees as a priority. If you want a quick confirmation , you will have to increase the fees to be selected before the others.
To assess these costs and choose which charges to assign to your transaction, you can visit the following site:
It provides a real-time estimate of the transaction fees required for a desired confirmation time . The shorter this period, the higher the cost of gas will be. If you don’t need a quick confirmation, you can use a low gas cost.
Today, many Ethereum wallets automatically estimate fees to pay for your transaction. But for some uses (participation in an ICO, decentralized finance), you will have to do the calculations yourself.