17

Can you break it down in terms of the cost of opcodes?

2

2 Answers 2

22

(I'm sure this has been asked before. If someone can find it, please duplicate.)

From Ethereum's Design Rationale document:

21000 gas is charged for any transaction as a "base fee". This covers the cost of an elliptic curve operation to recover the sender address from the signature as well as the disk and bandwidth space of storing the transaction.


Edit Feb 2022:

To make my original answer a bit more detailed, and quoting a post by Vitalik:

The cost of processing a tx includes:

  • Two account writes (a balance-editing CALL normally costs 9000 gas)
  • A signature verification (compare: the ECDSA precompile costs 3000 gas)
  • The transaction data (~100 bytes, so 1600 gas, though originally it cost 6800)

Some more gas was tacked on to account for transaction-specific overhead, bringing the total to 21000.

1
  • This seems off since 21000 is surely the gas limit rather than a base fee and is only one of multiple factors in the equation to calculate gas. Apologies if Im misunderstanding things. Trying to develop my own understanding. The notion that it is a gas limit also seems odd since it seems to be fully consumed every time. Probably a lot of old systems nomenclature wrapped into things making it seem odd years later I guess Oct 13, 2022 at 8:16
2

Any transaction has a 'base fee' of 21,000 gas in order to cover the cost of an elliptic curve operation that recovers the sender address from the signature, as well as the disk space of storing the transaction, according to the Ethereum White Paper. You can visit my blog to learn more about the concept of Ethereum Gas.

Your Answer

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

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