How is ETH addressing its Gas Prices?
A few weeks ago, we sat down with our resident expert, Sascha Hanse, to discuss Ethereum, proof of stake, and Eth2 in context to help everyone on our team have a better understanding of the upcoming changes to the blockchain. This is the third article in this series — find the first one here.
In our previous post, we established that supply and demand determine gas prices. It all comes down to a relatively straightforward situation. I have a transaction that I want to be included in the next block. Unfortunately, blocks are only so big, and the node that proposes the next block can't include every transaction. Therefore the gas price you want to pay decides whether or not your transaction will be included. As a result, the high demand for block space has driven gas prices to extreme highs. High prices are a problem that stands as a barrier to the widespread accessibility of an "open" Ethereum network.
The obvious solution would be to find ways to record things across the network. Blocks on the main chain don't need to record every action that happens on the network. The current thought on how this might look is using "rollups." Rollups put simply, are their own blockchains that are anchored in the main chain. Rollups basically ask if the dApp you are using is available on its layer 2 chain (not the main chain). By storing your transactions on a separate chain, rollups delay when your desired action is recorded on the main chain by batching it with other data from the layer 2 chain. Rollups are designed to use less of the main network's bandwidth and ultimately lower gas prices. Most of the proposed solutions to help scale Ethereum revolve around rollups.
Layer 1 vs. Layer 2 Solutions
Layering is a concept that comes from network theory, where you have distinct, stacked layers that build on top of each other's infrastructure. For example, the most basic layer 1 might be hardware. Imagine two physical machines connected to each other — the lowest layer. Then on top of this layer 1 infrastructure are layers of abstract building blocks, like the internet (layer 2 - a system building off of the computer), social media (layer 3 - a system building off of the internet), etc. Each layer takes advantage of the previous layer.
In the case of Ethereum, layer 1 is the main “beacon” chain of the Ethereum blockchain. Layer 1 is the central source of truth for Ethereum. Layer 2 would be a system built on the layer 1 main chain that takes advantage of the Layer 1 infrastructure. If layer 1 Ethereum blockchain has a specific capacity for transactions, then layer 2 would have a different higher capacity.
Does Layering solve gas prices?
If you have lots of layer 2 solutions, they will also overwhelm layer 1 blockchain at some point because this layer 1 beacon chain is still the ultimate source of truth, with a finite amount of block space. Things still need to be posted to the L1 beacon chain. So, to create lower gas prices and traffic that endure, both layers have to scale. There's no way around it.
Think of it as a toll road, where the road is layer 1, and a carpooling system is layer 2. When everyone is driving on the highway in their own car, it can quickly become congested with lots of traffic, and every vehicle has to pay a fee to enter. However, a carpooling system, which leverages the highway's infrastructure to be more efficient, allows people to batch together in busses before entering the highway. Carpooling takes up much less space, lowers the cost per person to use the highway, and contributes to a much more efficient system. However, the size of the road hasn't changed at all. So, despite the carpool system's efficiency, the road will have traffic once again with enough busses. While carpooling frees up many lanes on the toll road in the short term, it also invites more people to use this type of transportation, which over the long term, will drive the price per person back up. Basically, if you create more space on the Ethereum network, people are going to use it. In the short term, gas prices will lower. However, we predict that this will only invite more people to use Ethereum and gas prices will begin to creep up once again.
Sharding (layer 1 solution)
Shards are smaller chains built alongside the beacon chain. The beacon chain works as a central authority to which all of these shards constantly need to report back with their latest state. Through this mechanism (through the beacon chain), shards can also coordinate with each other.
Imagine you have a popular game that uses a smart contract. This game's smart contract could sit in one shard and all users who interact with this game use up only one shard. If nobody on the Ethereum network uses any other contracts, only this one shard will receive traffic. Now, imagine that the game is in one shard and a DAO is in another shard. The DAO only uses one transaction every 10 minutes while the game makes one transaction per second. Because that DAO is in a different shard from the game, it won't have to deal with any of the game's traffic. In the DAO's shard, the transaction fees would also be much lower, and there would be little congestion at all. In a sharded blockchain, transactions are split across lots of different sub-chains. However, people will begin to optimize, and over time, network congestion will likely be relatively similar across shards.
Sharding is a layer 1 solution because it changes the Ethereum base protocol. For example, sharding the Etherum blockchain would involve replacing the current Ethereum chain with a completely new one, broken into shards. An example of a layer 2 solution would be a system that's states are posted onto the layer 1 chain, like roll-ups.
Roll-ups, zkSnarks (layer 2 solutions)
There can be many things happening in a roll-up, but you still need to post down to layer 1 because layer 1 is the ultimate source of truth for the network. Everything that happens in a roll-up is in a different higher-level system. Even if layer 1 state is sharded, each shard could have its own layer 2 solutions.
The current standard for roll-ups is zkSnarks (Zero-Knowledge Succinct Non-Interactive Argument of Knowledge). Knowledge proofs, in general, are not very new — they have been around since the 80s. They just haven't been practical or computationally feasible to use until recently.
A zk-SNARK is a cryptographic proof that allows one party to prove it possesses certain information without revealing that information. This proof is made possible using a secret key created before the transaction takes place. (https://www.investopedia.com/terms/z/zksnark.asp)
In theory, you could use a zk-SNARK to prove that you have a batch of transactions, and then recieve a cryptographic proof that is much easier to verify than it is to re-rerun the entire original proof. For example, you have a computation that takes 10 minutes to run, and after those 10 minutes, you produce a cryptographic proof that takes around a hundred milliseconds to verify. That's the idea. This cryptographic proof then contains all of the data rolled up in a much smaller package; roll-ups compress data before being posted to the main chain, taking up less bandwidth on the chain.
While sharding and rollups are great solutions for supporting the continued growth of the Ethereum network, they don't look like they will be long-term solutions to the network's high gas prices and its inaccessibility to the average person. As the network becomes more efficient — gas prices lower, and network bandwidth increases — its growth will likely accelerate. If you create more space on the Ethereum network, people are going to use it. So, if we are to see enduring changes, then the growth and development of scaling solutions will have to outpace Ethereum’s user growth. To create lower gas prices and traffic that endure, both layers must scale.
If you were forwarded this newsletter and you like it, you can subscribe here: