Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. The transaction will not be added to the blockchain. Note that the estimate may be significantly more than the amount of gas actually used by the transaction, for a variety of reasons including EVM mechanics and node performance.


  1. Object - [required]

    • from [required] The address the transaction is sent from.

    • to [required] The address the transaction is directed to.

    • gas [optional] hexadecimal value of the gas provided for the transaction execution. eth_estimateGas consumes zero gas, but this parameter may be needed by some executions.

    • gasPrice [optional] hexadecimal value of the gasPrice used for each paid gas.

    • maxPriorityFeePerGas [optional] Maximum fee, in Wei, the sender is willing to pay per gas above the base fee. See EIP-1559 transactions.

    • maxFeePerGas [optional] Maximum total fee (base fee + priority fee), in Wei, the sender is willing to pay per gas. See: EIP-1559 transactions.

    • value [optional] hexadecimal value of the value sent with this transaction.

    • data [optional] Hash of the method signature and encoded parameters. See the Ethereum ABI specification.

If no gas limit is specified, geth uses the block gas limit from the pending block as an upper bound. As a result the returned estimate might not be enough to executed the call/transaction when the amount of gas is higher than the pending block gas limit.


curl \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_estimateGas", "params": [{"from":"0xff1231b8b8c3d87158927f21bb1d4be64ce20d08","to":"0xf62cdd71237efa791acca526e2692d579bc1cd32","value":"0x186a0"}]}'


Return the contract execution result.

  "id": 1,
  "jsonrpc": "2.0",
  "result": "0x5208" // 21000

Last updated