I know that a Gwei means 1000000000 wei, but when we send a transaction with 21000 gas, is that mean we send 21000 Gwei? please explain Gwei for me


Gas is needed by miners to execute a transaction. The more complicated a transaction is, the more gas they will need.

When you send a transaction, you can choose two things:

  • The gas limit in gas: The maximum amount of gas the transaction is allowed to consume

  • The gas price in Gwei/gas: How much Gwei you're willing to pay per unit of gas

Multiplying these numbers together, you get the maximum transaction fee you're willing to pay for the transaction in Gwei.

If you set the gas price to 1 Gwei/gas, a transaction with a gas limit of 21000 gas will cost you a maximum of 21000 Gwei.

  • So, is Gwei equal to gas? – zediziza Nov 4 '17 at 15:33
  • 2
    @zediziza Only in transactions where the sender set the gas price equal to 1 Gwei/gas. In transactions where the gas price is 15 Gwei/gas, 1 gas is equal to 15 Gwei. – Jesbus Nov 4 '17 at 16:37
  • 2
    So why we need create separate field instead of one. thanks. – hqt Mar 8 '18 at 19:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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