This post was originally published on my website.
In our fast-paced world, there are many systems that we expect to be fast. One such system is payments: when you buy something, the last thing you want is to be waiting for a minute with a freezing jug of milk in your hand!
First, let’s define what I mean by “scalability.” In this article, I will define it using two metrics: latency, meaning the time it takes from when you submit a transaction to when it clears, and transactions per second, or TPS, meaning how many transactions the network is capable of handling.
Let’s first compare Ethereum to some other commonly-used payment solutions.
Most people have a VISA credit (or debit) card. According to VISA themselves, they’re capable of handling up to 24,000 transactions a second. This is quite a large number! In practice, though, they don’t actually handle that much.
According to this website, VISA and Mastercard combined handled 31.2 billion transactions in 2019. Because VISA is more prominent than Mastercard, I’m going to assume they contributed 25 out of the 31.2 billion transactions.
Doing the math, this is equal to about 68.5 million transactions a day! This translates to just under 800 transactions a second. This means that they have a lot of room to scale and that it likely won’t be replaced any time soon.
However, VISA has a problem with latency. When you submit a transaction, the network has to give you time to make sure this transaction is valid and came from you. Because of this, there’s usually a 1-2 day grace period in which the transaction appears but isn’t cleared yet.
Ethereum, on the other hand, has no such worries, because it assumes that as long as the transaction is correctly signed by the private key, then it’s a valid transaction.
Ah, Bitcoin, the “OG” cryptocurrency. Bitcoin also has a little problem with scalability. Be prepared, though, some math incoming!
So first, Bitcoins supports a practical block size of around 2 megabytes. (I’m simplifying here, to make the calculations easier.) At an average transaction size of around 500 bytes, that’s around 4,000 transactions per block.
Bitcoin aims to have an average block time of 10 minutes, meaning that we end up with about 6-7 transactions per second. That was a far jump from VISA!
Okay, so what about Ethereum? Let’s do the same calculations again. Ethereum has a goal of 15 million gas per block, but a hard cap at 30 million. A simple transfer of ether takes 21,000 gas, meaning the target is about 700 transactions per block, and the cap is at 1,500 transactions per block.
The Ethereum network aims to have a block time of around 12 seconds. This means that there are around 50-125 transactions per second.
But wait! The astute among you may have realized that many Ethereum transactions are more than just a transfer. Swapping tokens, voting for a DAO, and even gambling, all require extra computing power, using up more than 21,000 gas!
By writing a small program that analyzes the past 1,000 blocks, I found that the average transaction uses around 100,000 gas. This is 5x more than a simple transfer!
Using this new gas value, we get around 150-300 transactions in a block. With a 12-second block time, that’s 12.5-25 transactions per second! That’s a little more than Bitcoin, but not enough if we want to make this a global processor.
Luckily for us, people much smarter than us have figured out ways of speeding up Ethereum. Here are just a few of the most common methods people use. Note, however, that most of these create a separate chain from Ethereum!
Layer-2 solutions refer to creating a side-chain to offload the computation and then submitting data to the Ethereum Mainnet to benefit from its security.
This is a deep rabbit hole that eventually ends in cryptography and math, the likes of which I’m not paid enough to understand. If you’re interested in attempting to learn it, the Ethereum website has more information.
In summary, though, layer-2 transactions are processed by separate nodes, who then combine all the transactions to submit to the Mainnet. This way, you get more transactions per transaction.
Depending on the type of layer-2 network, they might either submit proof that all transactions are valid or a way for someone to challenge a transaction they believe is incorrect (in other words, innocent until proven guilty).
An example of a Layer-2 solution is Polygon. This time, I won’t show my work, but Polygon can handle around 130 transactions per second.
Again, this is something that’s best explained using math high above my pay grade, but I’ll do my best to explain it.
Basically, when you submit a transaction, instead of submitting the transactions to the Mainnet, it submits a single transaction with a Merkle root and a zero-knowledge proof that all the transactions are valid.
Similar to Layer-2 solutions, this allows for multiple transactions to be processed in a single transaction on the Mainnet, leading to many more transactions for each Ethereum transaction.
However, the benefit is that Validium chains don’t even send the transactions, just the Merkle root plus proof that the transactions are valid, meaning they have a much larger scaling possibility, as the Ethereum mainnet isn’t a bottleneck.
If you’re interested in learning more, again, the Ethereum website goes into much more depth.
I’ve created a small playground to calculate the TPS of different blockchains. You can find it on my website.
The Ethereum network is struggling to keep up with the large amount of transactions that are submitted each day. However, many people are working together to create solutions, and we already have many great methods of scaling.