0

Q:- While sending only Ether One wallet to another wallet(NO SMART CONTRACT), do we need to define the default gas limit and price?

i.e. 21000 * 3 OR 21000 * 4 OR 21000 * 5 etc

Or

I've need to use estimate gas function web3.eth.estimateGas(callObject [, callback])?

because the web3.eth.estimateGas function always return 21000 gas in all the case when I'm giving two params "value" and "to_address" to this function

1 Answer 1

0

eth_estimateGas estimates how much gas a transaction execution would require based on the current state of the blockchain. The gas consumed does not depend on the gas price (not directly, anyways, and in most transactions there is no relation at all).

The gas price is simply an indicator saying that "I am willing to spend up to gas price * max gas ether on this transaction". You must specify both a max gas and a gas price in your transaction (although many wallets will autofill both for you with some default/estimated values).

A pure ETH transfer from one externally owned account to another will always consume 21000 gas, so that is what estimate gas will always return. The final fee will then depend on your gas price.

2
  • Ok and the Gas Price if i set 1, How much it's chances to make transaction fail? And what is the sufficient Gas Price I 'll set for 1 ether or 100000 ether?
    – Heartbeat
    Commented Oct 8, 2018 at 9:58
  • The amount of ether being moved is irrelevent. The gas price simply controls the priority. You can view current gas price status on ethgasstation.info Commented Oct 8, 2018 at 10:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.