14

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

1

2 Answers 2

18

(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

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, privacy policy and cookie policy

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