When users perform operations such as connecting their wallets or trading NFTs, they need to pay a certain amount of Gas fees. What is this fee, how is it generated, and is there any way to save a bit?
What is Gas?
Gas is the computational unit in the Ethereum network. Every transaction or execution of a smart contract requires a certain amount of Gas. The price of Gas is set by the validators, who can choose whether or not to accept the Gas price you pay. If they accept the Gas price you pay, they will execute your transaction and submit the result of that transaction to the Ethereum blockchain.
It's important to note that Gas fees are paid to "validators," so AlienSwap doesn't receive or can't refund these fees.
What is a validator?
A validator is a network node that participates in the Proof-of-Stake consensus mechanism of Ethereum 2.0. These nodes participate in network consensus by staking Ethereum tokens, which are locked in the validator's wallet as collateral. Validators are required to run a full node software and participate in block validation and packaging to receive staking rewards and transaction fees. The main role of validators is to ensure the security and stability of the Ethereum network, while also contributing to the development of the Ethereum ecosystem.
Calculation method for gas fee
Let's say Jordan has to pay Taylor 1 ETH. In the transaction, the gas limit is 21,000 units and the base fee is 10 gwei. Jordan includes a tip of 2 gwei.
The total fee would now be: units of gas used * (base fee + priority fee) where the base fee is a value set by the protocol and the priority fee is a value set by the user as a tip to the validator.
i.e 21,000 * (10 + 2) = 252,000 gwei or 0.000252 ETH.
When Jordan sends the money, 1.000252 ETH will be deducted from Jordan's account. Taylor will be credited 1.0000 ETH. Validator receives the tip of 0.000042 ETH. Base fee of 0.00021 ETH is burned.
Additionally, Jordan can also set a max fee (maxFeePerGas) for the transaction. The difference between the max fee and the actual fee is refunded to Jordan, i.e. refund = max fee - (base fee + priority fee). Jordan can set a maximum amount to pay for the transaction to execute and not worry about overpaying "beyond" the base fee when the transaction is executed.
How to Save on Gas Fees
Gas fees are an unavoidable part of the Ethereum network, but there are a few tips that can help you save on gas fees.
1. Choose the right time to transact:
As the transaction volume on the Ethereum network increases, gas prices go up because higher gas prices are required to get transactions included and confirmed. Therefore, transacting during network peak times may result in very high gas fees. Choosing to transact during off-peak times can lower gas prices and save on gas fees.
2. Choose the right gas price:
Gas fees are determined by the complexity of the transaction and the price of gas. Choosing the right gas fee can reduce unnecessary expenses. Ethereum wallets usually offer different levels of gas fee settings that can be selected based on actual needs.