Difference between revisions of "Not all transactions are equal"
Line 17: | Line 17: | ||
To compare the two networks in terms of efficiency, one also needs to consider the replication factor. In ICP the typical replication factor is 13 versus approximately 550'000 for Ethereum (a number that is steadily increasing and rose by approximately 100'000 over the last 6 months). | To compare the two networks in terms of efficiency, one also needs to consider the replication factor. In ICP the typical replication factor is 13 versus approximately 550'000 for Ethereum (a number that is steadily increasing and rose by approximately 100'000 over the last 6 months). | ||
Concluding, ICP is at least 3.4 million times more efficient than Ethereum. | Concluding, ICP is at least 3.4 million times more efficient than Ethereum. | ||
+ | |||
+ | == EdDSA verification experiment == | ||
+ | To get a view on the validity of the above calculations in a real-world setting, comparisons can be made by running a given function. A realistic function that is used often in the blockchain setting is signature verification. | ||
[[L1 comparison]] | [[L1 comparison]] |
Revision as of 14:53, 12 May 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 the amount of computational work of Ethereum per transaction.
To compare the two networks in terms of efficiency, one also needs to consider the replication factor. In ICP the typical replication factor is 13 versus approximately 550'000 for Ethereum (a number that is steadily increasing and rose by approximately 100'000 over the last 6 months). Concluding, ICP is at least 3.4 million times more efficient than Ethereum.
EdDSA verification experiment
To get a view on the validity of the above calculations in a real-world setting, comparisons can be made by running a given function. A realistic function that is used often in the blockchain setting is signature verification.