Ask us anything. We're here to help.

Controlling gas prices on withdrawals

Zero Hash enables users to set the gas price that they are willing to spend on an ETH/ERC-20 withdrawal. This is currently only available over API.

Primer on Gas

The Ethereum blockchain processes transactions using two fundamental components:

  1. Gas. Gas is the effort required to compute, or mine, the transaction. Think of this as gas required to run a car. For example, if your car does 25 miles per gallon (mpg), then you need 4 gallons of gas to drive 100 miles.
  2. Gas Price. This is how much you are willing to pay for each unit of gas, denominated in Gwei (1 Gwei = 0.000000001 ETH, refer here for ETH conversion rates). Think of this as the dollar-value needed to purchase 1 gallon of oil. For example, if you want to drive 100 miles with a 25 mpg car, and the gas price per gallon is $3, then it will cost you $12 ($3 per gallon x 4 gallons) to drive 100 miles.

Gas at Zero Hash

Zero Hash controls the amount of gas that is used to process each withdrawal, however users can control the gas price. To continue the car analogy, a driver has limited control over the amount of gas that is needed to drive 100 miles, but they can control how much they are willing to spend on gas to drive that distance. This is done via the gas_price field on a POST /withdrawals/requests request.

Additionally, gas fees will be deducted from your main deposit ETH address displayed on the portal. Payment processors will be responsible for monitoring and managing their own gas fees which includes deposits of additional ETH to facilitate platform withdrawals.

Field Characteristics

  • Optionally included by users via the POST /withdrawals/requests endpoint
  • Will be returned for all requests via the GET /withdrawals/requests endpoint
  • The gas_price field is a string / number format
  • Only relevant for ETH/ERC-20 tokens
  • More details can be found here

How it Works

Zero Hash references gas rates provided by the Etherscan gas tracker. Etherscan monitors the Ethereum blockchain and provides analytics on current market-driven gas prices, and provides suggested rates to achieve a confirmation within certain timeframes. These are split into 3 buckets. On October 20th, 2020, the rates provided by Etherscan were as follows:

  1. Low (SafeGasPrice). 119 gwei. Estimated confirmation time: ~ 13 mins:13 secs
  2. Average (ProposeGasPrice). 131 gwei. Estimated confirmation time: ~ 2 mins:13 secs
  3. High (FastGasPrice). 133 gwei. Estimated confirmation time: ~ 45 secs

If you provide a value for gas_price on a POST, we will validate, in real-time, that the gas_price is equal to or larger than the maximum of the last 5 values for Low (SafeGasPrice). If it is lower, then we reject the withdrawal.

As the field is optional, if not included, we will leave the field as null in response, and then apply the most current medium rate (subject to change based on network conditions) at the time of publishing to the blockchain.