Gas Costs in Ethereum

Published by Mario Oettler on

Last Updated on 24. March 2025 by Mario Oettler

Each opcode costs a certain amount of gas. This reflects the amount of computing required for each block proposer. Besides computation, storage is another valuable resource. Therefore, occupying storage space also costs gas.

There are different types of memory in the EVM:

  • Storage: This is the data stored on the blockchain. It is permanently stored and therefore most expensive to write to and read from. Writing to an unallocated storage space costs 21,000 gas.
  • Memory: Memory is only used in the context of execution. This can be the Smart Contract or a function. It is deleted when this context is closed. It is therefore much cheaper than storage.
  • Call data: This is for data passed from external calls as parameters to functions.
  • Stack
Categories: