If you are into blockchain or crypto space for a while, you may have heard on Gas. Gas is the fee required by any transaction to get minted/verified on blockchain. So what basically is the fee for.
Gas Fee = amount of tokens that will be burnt for the transasction(the base fee)+ the miner reward
Why Gas Fee ?
The miner gets reward for each transaction they verify on the blockchain. This helps the miners to earn some tokens as a reward for their computational power.
On ethereum, Gas fee is calculated in GWEI — the smallest unit of ETH. 1 ETH = 10^-9 GWEI.
Below picture sums up the basics of how a transaction and Gas works 👇
The architecture is not that simple but this is how the flow of transaction is. There can be different use case for transactions as given below -
- Deploying Smart Contract
- Sending Ethereum to another person
- Interacting with deployed smart contract
- Minting NFT’s
Everything which changes the state on blockchian refers to as transaction and it will take Gas Fee for it.
Let’s optimize Gas Fee, when doing transaction (from the official docs)
Gas fee can be as high as your wallet balance, just kidding but yes it can 😆
- Use gas Tracker and do transaction when the gas fee is low
- Attach Gas Limits to transaction to make sure you are in control.
- Use Layer 2 solutions like Polygon or sidechain for scaling with affordable Gas Fee.
Follow BlockTrain for more:
- Roadmaps : blocktrain.info/roadmaps
- Dev related : blocktrain.info/developer
- Non dev related : blocktrain.info/non-developer
- Hindi stuff : blocktrain.info/hindi
- Chains : blocktrain.info/chains
- Concepts : blocktrain.info/concepts
- Defi : blocktrain.info/defi