r/dfinity•
shayaaa

Energy usage of a transaction?

Recently Solana posted their energy usage per transaction at 1,837 J or less than 2 Google searches. Comparatively, ETH (in current PoW) uses 126k J.

Has this number been quantified for ICP?

Posted Nov 25, 2021, 7:22 PM UTC

13
alin_DFNTeam Member•

First, to get this out of the way, I have no idea how Solana reached that number: their blog post says "Read the full report here" but doesn't link to it. They say 3.186M kWh per year, 20M transactions (presumably also per year) and come up with 0.00051 kWh per transaction. According to my back-of-the envelope calculation, 3.186M kWh divided by 20M transactions comes out to about 0.15 kWh, or about 300x higher.

Anyway...

I guess it's really hard to come up with a good estimate. First of all, do you measure exactly the energy required to execute a transaction? Or do as they (maybe?) did and take the total yearly power consumption and divide it by the number of transactions? Second, IC transactions can vary wildly in size: anything from incrementing a counter to whatever you can squeeze in 1 second worth of server CPU core cycles.

But going with the latter, worst case scenario of a 1 second transaction. And let's make some other (also relatively pessimistic) assumptions:

  • this is a 13-replica subnet (as pretty much all IC subnets are right now);
  • each server requires about 1 kW of electricity, cooling and all (based on Solana's numbers, they appear to use 300 W);
  • due to protocol overhead and inefficient utilization, only 10 canisters run in parallel on average, even though the servers have 64 core CPUs.

1 Watt is 1 Joule per second, so 1 kW means 1000 Joules per second. Times 13 servers, that's 13 kJ/s. Because we've assumed a 1 second transaction, that's 13 kJ. But because we're executing 10 such transactions in parallel, that comes out to 1.3 kJ per transaction.

I don't know what the actual number of transactions executed so far on the IC is; and I don't know how many running nodes there are. You can probably look that up on the IC dashboard.

But assuming a steady state where the size of the IC is driven by actual usage; and relatively good resource utilization (Google was striving for ~50% back when I worked there); I believe the numbers above make sense.

An ever simpler calculation would be that IC transactions executes on 13 servers instead of one. And there's some overhead due to the protocol and its inefficiencies (e.g. all CPU cores on a replica need to complete a full round's worth of transactions before any of them can move on, in order to ensure deterministic execution); let's say the overhead is 100% (i.e. 2x). So compared to a traditional single-homed application you'd need 26x more resources. Compared to a traditional multi-homed, distributed application that can transparently deal with machine failures (but does not provide censorship resistance or decentralization) it's definitely less than 5x. (And remember that the 13x above can be tuned at will.)

Overall, not bad, I'd say.

10
shayaaaOP•

Wow thank you for such a detailed response u/alin_DFN !! You rock

5
beerandnosh•

Hi u/alin_DFN and thanks for posting this. I’m interested in writing about ICP, especially digging into what claims can be made about how green it is and what the carbon footprint / electrical usage is compared to other blockchain systems. Would it be possible to formalize some of these claims to promote ICP as a green blockchain solution?

1