header-langage
简体中文
繁體中文
English
Tiếng Việt
Scan to Download the APP
Partnered With:

Ethereum transfer fee and arrival speed, cleverly set GAS can save money?

Read this article in 8 Minutes
When transferring ETH or ERC-20 tokens through a wallet, we know that there will be a handling fee for this transfer. A: Then, what is the commission charge for the transfer?
原文标题:《 科普 | 以太坊转账手续费与到账速度,巧妙设置 Gas 能省钱? 》
Original author: Vernacular Blockchain


Transfer money through your wallet ETH or   ERC-20 Token  We understand that there is a service charge for this transfer. A: Then, what is the commission charge for the transfer?


If the transfer is accompanied by "lettering", does it need to charge more fees? Today, Baymax is going to talk about Ethereum's GAS mechanism.


When we transfer money on the Ethereum network, even though the final fee is ETH, we don't actually consume ETH directly inside Ethereum, we consume Gas. The word "Gas" means "fuel" in English, and it consumes Gas to operate on the Ethereum network, just like it consumes fuel to run a car.


So, how is the transaction fee (ETH) calculated? Let's take a look at a screenshot of Baymax's transfer on the Ethereum network:




Transfer fees on the Ethereum network are calculated as follows:


Transaction Fee (ETH) = unit price of GAS x amount of GAS consumed


In Baymax's deal, the Gas Price is 5Gwei, which is 0.0000000005ETH (8 zeros after the decimal point). The smallest unit of ETH is WEI, but when we talk about Ethereum GAS, we often use GWEI. The relationship between ETH, GWEI and WEI is as follows:


1 ETH = 10^9 Gwei (9 0) = 10^18 Wei (18 0)


Knowing the unit price of Gas, let's take a look at the amount of Gas consumed by the transfer with the inscription in Baymax: 24,876. So, according to the formula above, multiply the unit price by the quantity to get the handling fee of the large cost:


Fee = 0.0000000005ETH x 24876 = 0.00012438ETH


When a car goes to a Gas station to add fuel, the price of fuel is basically fixed, but in the Ethereum network, the unit price of Gas can be set by itself. However, it is important to note that the unit price of Gas affects how quickly the deal can be packaged. In other words, the higher the price you pay for Gas, the more likely miners will package your deal in order to maximize their own interests.


The figure below shows the unit price of Gas in the actual operation and the waiting time for the transaction to be packed, as measured by ethGasStation.info.


In the left graph, we can see that more than 70% of the Ethereum network transfers to Gas units between 4 and 20Gwei, with transactions less than 1Gwei or greater than 50Gwei taking up a small proportion.


In the graph on the right, we can see that if the unit price of GAS is 4Gwei, the average wait time for packing transactions is 0.6 minutes; If it is 20Gwei, the average wait time is 0.2 minutes.




The commonly used IMTOKEN wallet, in the unit price setting of GAS, provides 5 ~ 100Gwei, and the minimum unit price of the wallet is set to 5Gwei, which ensures that the transaction can be packed within a reasonable time. Of course, if you want to jump the queue and be packed by miners as soon as possible, you can also increase the unit price of GAS by yourself.


Having said the unit price of Gas, let's move on to the amount of Gas consumed.


In the Ethereum network, each transfer, no matter how large or small, consumes a fixed amount of Gas of 21,000, and adding notes (" lettering ") consumes additional Gas.


Back to the transaction of Baymax, the total amount of Gas spent by Baymax is 24,876, including 21,000 fixed consumption and 3876 Gas consumed by remarks. Note that the amount of Gas needed to be consumed depends on the length of the input content. The more content you have, the more Gas you need to consume.


If you take a closer look at the screenshot of Baymax's transfer, you will see that the amount of Gas Baymax spent is 24,876 followed by a parenthesis, which reads 41.46%. What does this percentage mean? If you take a closer look at the screenshot, you will see that there is also a Gas Limit of 60,000 and 41.46% of it is exactly 24876.


The Gas Limit is the maximum amount of Gas that can be consumed by this operation. You can set this Limit yourself. Baymax, for example, set the limit at 60,000, but did not reach that limit in practice, using only 41.46%. The general wallet will help you set this limit by default, for our ordinary users, the ordinary transfer of this limit do not need to consider.


The Ethereum network set this limit in case of a malicious smart contract, the execution of the contract will consume an unlimited amount of fuel, which will cause the transaction party's ETH balance to be completely consumed. (A malicious smart contract may be a program Bug, such as the execution of the contract being trapped in an endless loop.)


If the Gas Limit is set too low, such as 10000, the amount of Gas required for any one transfer is at least 21000, which is much more than the Gas Limit you set, the transfer will fail. In other words, the Gas Limit can affect whether a transaction is successful or not.


The original link


Welcome to join the official BlockBeats community:

Telegram Subscription Group: https://t.me/theblockbeats

Telegram Discussion Group: https://t.me/BlockBeats_App

Official Twitter Account: https://twitter.com/BlockBeatsAsia

举报 Correction/Report
Choose Library
Add Library
Cancel
Finish
Add Library
Visible to myself only
Public
Save
Correction/Report
Submit