This article takes you easily to understand Filecoin Gas fees

This article takes you easily to understand Filecoin Gas fees

Loading

“Gas” was originally applied to the Ethereum blockchain as a standard for measuring the computing and storage resources consumed by the information on the chain. Now the reserved concept is also used in the Filecoin network. Gas is considered to be the fuel of the Filecoin network. Just like the fuel consumption of a car during driving, sending a message on the Filecoin blockchain also consumes a certain amount of network resources, so the message sender needs to pay the Gas fee with FIL.

5 elements

The participants involved in the process of message sending and packaging mainly include message senders and block packaging miners . The Gas fees involved include GasLimit (the limit of Gas fees), GasUsage (Gas actually used), GasFeeCap (Gas fees) The limit), GasPremium (Priority Use Gas), BaseFee (Basic Fee) .

Mutual relations

We use the analogy of the fuel cost of a car. Sending a message A on the Filecoin chain is like a car driving through a section of highway a. The message sender is like a driver. When he sets GasLimit and GasFeeCap for A being packaged, it is like a The estimated fuel consumption and unit price of gasoline for driving, in order to be packaged smoothly (smoothly driving to the end), the set values ​​at this time are all estimated maximum values.

The consumption of driving is affected by the distance, of course, by the weather, wind resistance, and terrain. According to the experience of fuel consumption in the previous journey, the highway a behind driving already has a basic fuel consumption cost under ideal conditions. Compared with Filecoin, this estimated cost is BaseFee. In order to reach the destination faster, the driver can change 92# gasoline to 98#, which improves the driving experience and driving speed, but at the same time increases the cost. The GasPremium in the 5 elements is the cost that is actively set so that the sender’s message can be packaged more preferentially; when the distance, environmental impact, gasoline model, etc. are determined, the actual cost of the car will be clear. GasUsage is defined in the 5 elements, which is the actual gas cost of the message.

一文带你轻松理解Filecoin Gas 费

Figure 1. Cost of Message A, IPFS Force Area

Gas Fees consumption reason

Going back to the message packaging scene, as the resources on the chain are consumed, GasUsage * BaseFee will be burned. After all, part of the driving force of the car will be wasted by the road friction. Subtracting BaseFee from GasFeeCap will produce GasPremium, and GasPremium * GasLimit will be rewarded as a priority fee to miners who pack message A into the block. In addition, in particular, the difference between the estimated cost of GasLimit and the actual cost of GasUsage will be consumed as an overestimated loss (just like taking too much gasoline on the road, a part of it will evaporate), and finally the rest The budget of will be returned to the sender of the message.

一文带你轻松理解Filecoin Gas 费

Figure 2. Fees paid by the sender, IPFS force area

The default method of the current Filecoin network is that miners subjectively select message packaging based on GasFeeCap / GasLimit. Given GasLimit, it can maximize the expected income of miners and improve overall service efficiency and experience. When the network is congested (the road condition is bad) and the BaseFee (the wasted consumption caused by friction) is high, miners can choose to compress the block (reduce the message packing), thereby reducing the total GasLimit (reducing the distance) to reduce the BaseFee.

Brief meaning

The consumption of Gas Fees gives miners the power to maintain network data while optimizing the economic structure rules, providing service quality assurance for these types of messages, which will enable customers, miners, R&D, and currency holders in the ecosystem to form a more lasting cohesion, and more It is a benefit for Filecoin to stick to the long-term development of the “storage” and weaken the “mining” business.