Amazon AWS and Google Cloud all base their pricing off of, among a few other things, the amount of compute and storage used. For compute, it's based on time, how much time the computer runs. This is very general and abstracts away the need to, for example, count how many times each Assembly instruction is invoked and with which operands. This would significantly interrupt performance if they did it that way, but it seems that the blockchain technologies all went the path of monitoring the individual actions/operations either through transactions directly or Smart Contracts in the case of Ethereum.

So basically I'm wondering why this is, why it wasn't decided to just base everything off compute time and storage (and bandwidth I guess, but mainly focusing on compute time here). This way a transaction would just have to have a start and end timestamp and wouldn't have to really serialize anything, which would mean you could monitor everything in detail pretty much. Wondering why it was done differently.

1 Answer 1


Ethereum basically does base its pricing on computing time and storage costs. Plus bandwidth (transaction cost). All instructions have an associated gas cost. So, as I see it, Ethereum is more precise in its calculations but it's basically based on very similar principles.

As to the why Ethereum does it this way... I can think of at least a few reasons:

1) If it was simply based on computing time different nodes would have different gas costs. A faster node would compute everything faster. So could a faster node include more transaction in a block? This would all lead to centralization - a faster node would gain more gas rewards and therefore it'd be more beneficial to have a fast node. Slower nodes would slowly die out.

2) Who would measure the compute time and how? The network itself has no idea how long it takes for a node to compute something. It would obviously not be a good idea to simply let the node tell how long the processing took (and get paid accordingly). It would be easy for nodes to cheat in various ways.

3) There are still the other costs, such as storage and bandwidth (transactions). They are priced based on known static instructor costs. It would probably get difficult to combine different calculation methods.

All in all, different pricing models might easily lead to centralization in different ways. One of the main ideas of Ethereum is to allow different nodes to participate in a fair way. The more the system favors certain types of nodes, the less secure it would get.

  • Awesome, good to know! I thought it would come as a performance hit to do it this way. Wondering if you could point me to the source code for Ethereum that invokes a contract's functions one by one, and then does the charge. That would be really interesting to see!
    – Lance
    Feb 17, 2019 at 15:26
  • Good point on (1), same with (2).
    – Lance
    Feb 17, 2019 at 15:26
  • Sorry, I'm not familiar with the code so can't point you forward with that. Feb 17, 2019 at 15:31
  • Here we go.
    – Lance
    Feb 17, 2019 at 15:39
  • This say's it's not based on compute time but is instead based on individual instructions' evaluation.
    – Lance
    Feb 17, 2019 at 15:42

Your Answer

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

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