Difference between revisions of "Not all transactions are equal"

From Internet Computer Wiki
Jump to: navigation, search
Line 13: Line 13:
 
The IC executes more than 20 billion replicated Wasm instructions per second. Under the simplifying assumption that all instructions are comparable, this means the IC runs the daily number of ETH instructions in less than 6 seconds.
 
The IC executes more than 20 billion replicated Wasm instructions per second. Under the simplifying assumption that all instructions are comparable, this means the IC runs the daily number of ETH instructions in less than 6 seconds.
  
To see this, consider that Ethereum executes 1,250,000 instructions and 15 transactions per second, which means that there are on average 83,333 instructions per transaction. While the IC executes 20 Billion instructions and 3,000 update calls per second, there are on average 6,666,667 instructions per call. Comparing the work intensity of the two blockchains, taking the ratio of instructions per transaction (6,666,667/83,333) ICP performs 80x more work than Ethereum
+
To see this, consider that Ethereum executes 1,250,000 instructions and 15 transactions per second, which means that there are on average 83,333 instructions per transaction. While the IC executes 20 Billion instructions and 3,000 update calls per second, there are on average 6,666,667 instructions per call. Comparing the work intensity of the two blockchains, taking the ratio of instructions per transaction (6,666,667/83,333) ICP performs 80x more work than Ethereum.

Revision as of 14:25, 16 March 2023

Whilst it’s typical for blockchains to flaunt metrics around transactions per second (TX/s) or transactions per day (TX/d), comparisons between blockchains only make sense when those transactions are roughly equivalent i.e. TX/s comparisons only make sense to compare within a single problem domain.

The ICP is a blockchain which aims to provide a general purpose world computer, capable of serving real web services directly to user's browsers without any need for web2 cloud providers. Individual transactions on the ICP can be considered to be richer and must do more computation than most other blockchains.

This page aims to explain the differences between the work performed by transactions on the ICP vs those on Ethereum.

ETH vs. ICP execution throughput

Both ETH and ICP are able to run (general-purpose) smart contracts. At the execution layer, contracts are translated to a lower-level virtual machine interpretable language. These are EVM in the case of ETH and a Wasm-compatible runtime in the ICP case. Both EVM and Wasm instructions include arithmetic instructions (e.g., add, mul, div), but also more smart-contract specific instructions (e.g., reading and writing memory). The latter are in general more expensive operations in terms of consumed resources, which is then translated to the amount of gas used for each opcode of ETH and cycles used for ICP.

To compare the overall throughput of the two blockchains (i.e., how many ops per second can be handled), one needs to make several assumptions. First, it is assumed that the simpler EVM instructions (e.g., add, mul, div etc.) are roughly equivalent to the Wasm instructions of the same type, both kinds being translated to a similar x86 instruction executed by the hardware. The comparison is much more complex and not apples-to-apples for the more complex operations. For a proper comparison here one would need to either (1) thoroughly understand the design of both execution layers or (2) run a similar program/benchmark on both blockchains and compare their overall performance. These two options are time-consuming and would lead to longer-term research efforts. For a quicker comparison, it can be assumed that all EVM instructions are equal in terms of gas cost (and also assume no fees are involved). Since ETH is currently burning approximately 108B gas units per day, and assuming each instruction costs 1 gas unit (which vastly underestimates the costs of memory access operations), it is clear that the ETH blockchain is running less than 108B instructions per day.

The IC executes more than 20 billion replicated Wasm instructions per second. Under the simplifying assumption that all instructions are comparable, this means the IC runs the daily number of ETH instructions in less than 6 seconds.

To see this, consider that Ethereum executes 1,250,000 instructions and 15 transactions per second, which means that there are on average 83,333 instructions per transaction. While the IC executes 20 Billion instructions and 3,000 update calls per second, there are on average 6,666,667 instructions per call. Comparing the work intensity of the two blockchains, taking the ratio of instructions per transaction (6,666,667/83,333) ICP performs 80x more work than Ethereum.