Hi, So before we get started I want to put a disclaimer I am no professional and I am not the best out there I am a student who is trying to type these shot blogs out in order to keep track. So let's begin.
Different types of fees!
Huh, yes there are fees we are supposed to pay on this infamous blockchain, and it's for mostly everything and anything except the time you want to view the data only in that case you do not have to pay for it (Kind of). Thank god we don't have to pay the price for viewing the data, or else looking at the current condition of the gas prices I would have shot myself to the knees if I had to pay for viewing the data (Lol). Here is an example of gas fees, trying to purchase an ENS. (If you are not familiar with ENS, I will write something soon about it too, just understand it's like your domain name). So the registration for the domain is only 5$ that's super cheap, but there is always a gas fee, which is 39.02$.Another Shooting in the knee situation.
Coming back here are the different types of Fees!
Base Fee
Gas Fee
Priority fee (tips)
Max fee
Base Fee
This is mandatory
Base fees in the blockchain is a fee taken in order to be included in the block. It is a mandatory element, however, this alone does not guarantee your inclusion in the block.
So, How is it calculated?
The base fee in Ethereum is actually calculated dynamically for each block, based on the current demand for block space and the available computing resources on the network. Also, the previous block is used in order to calculate the base fee.
The base fee is calculated by a formula that compares the size of the previous block (the amount of gas used for all the transactions) with the target size. The base fee will increase by a maximum of 12.5% per block if the target block size is exceeded. This exponential growth makes it economically non-viable for block size to remain high indefinitely.
The base fee can't spike instantly, it spikes with 12.5% of the previous block price.
Gas Fee
This is mandatory
This is required in every transaction on the Ethereum. These fees are paid in Ether and are used to compensate miners for the computational resources required to process a transaction. The gas fee is calculated based on the amount of gas used by the transaction and the current gas price, which is determined by the market demand for block space. Gas fees are essential for ensuring that the Ethereum network remains secure and efficient.
How does it remain secure?
Well, it prevents any spammer to spam the network. Making it harder for other agents to send transactions since Ethereum can only do 15-30 transactions per second.
If the network was free people would have just used it for wasting resources probably to send a ruppe (lol) like we do it in UPI transactions. These resources aren't freely available and are highly costly. So it is kind of mandatory to have this.
Priority Fee
This is optional!
It is an incentive that users pay to the miners. The users do this so that miners prioritize their transactions before others, for which they earn more than a nominal fee. They are also called Tips, just like we add a tip for taxi drivers in order for them to reach their destination faster.
This is sort of an auction, you have to outbid others in order for your transaction to be selected first. (Not only was the gas fee high but now we gotta play a game of outbidding other folks).
Max Fee
Well, this isn't like paying it's a mode to rather save. Let me explain
In Ethereum, a user can set a maximum fee limit, which is the total fee they are willing to pay for a transaction, including both the base fee and gas fee (but not including priority fees). This is done by setting the maxFeePerGas
parameter when submitting a transaction.