Skip to main content
added 3 characters in body
Source Link

On the Ethereum network, the gas fee is composed of a base fee and a priority fee.

The base fee is retrieved from the network and is based on the network workload. MetaMask will call the eth_getBlockByNumber method, this gives a lot of information about the block, including the base fee. You can retrieve the base fee also by calling the eth_gasPriceeth_getGasPrice method.

Then the priority fee is what goes to the miner. Generally, 2 Gwei is considered the minimum needed for a miner to pick it up.

Then the acual ETH value used for gas is calculated by doing:

(base fee + priority fee) * gas limit

The gas limit in 21000 units for a regular transfer on the ETH network, but it can be retrieved from the network using the eth_estimateGas method.

I have a repo that shows all this in Python using web3.py if you want to see how it works!

https://github.com/soos3d/Web3.py-estimate-gas-fees

On the Ethereum network, the gas fee is composed of a base fee and a priority fee.

The base fee is retrieved from the network and is based on the network workload. MetaMask will call the eth_getBlockByNumber method, this gives a lot of information about the block, including the base fee. You can retrieve the base fee also by calling the eth_gasPrice method.

Then the priority fee is what goes to the miner. Generally, 2 Gwei is considered the minimum needed for a miner to pick it up.

Then the acual ETH value used for gas is calculated by doing:

(base fee + priority fee) * gas limit

The gas limit in 21000 units for a regular transfer on the ETH network, but it can be retrieved from the network using the eth_estimateGas method.

I have a repo that shows all this in Python using web3.py if you want to see how it works!

https://github.com/soos3d/Web3.py-estimate-gas-fees

On the Ethereum network, the gas fee is composed of a base fee and a priority fee.

The base fee is retrieved from the network and is based on the network workload. MetaMask will call the eth_getBlockByNumber method, this gives a lot of information about the block, including the base fee. You can retrieve the base fee also by calling the eth_getGasPrice method.

Then the priority fee is what goes to the miner. Generally, 2 Gwei is considered the minimum needed for a miner to pick it up.

Then the acual ETH value used for gas is calculated by doing:

(base fee + priority fee) * gas limit

The gas limit in 21000 units for a regular transfer on the ETH network, but it can be retrieved from the network using the eth_estimateGas method.

I have a repo that shows all this in Python using web3.py if you want to see how it works!

https://github.com/soos3d/Web3.py-estimate-gas-fees

Source Link

On the Ethereum network, the gas fee is composed of a base fee and a priority fee.

The base fee is retrieved from the network and is based on the network workload. MetaMask will call the eth_getBlockByNumber method, this gives a lot of information about the block, including the base fee. You can retrieve the base fee also by calling the eth_gasPrice method.

Then the priority fee is what goes to the miner. Generally, 2 Gwei is considered the minimum needed for a miner to pick it up.

Then the acual ETH value used for gas is calculated by doing:

(base fee + priority fee) * gas limit

The gas limit in 21000 units for a regular transfer on the ETH network, but it can be retrieved from the network using the eth_estimateGas method.

I have a repo that shows all this in Python using web3.py if you want to see how it works!

https://github.com/soos3d/Web3.py-estimate-gas-fees