This publication will explore gas tokens and their future.
Ethereum Blockchain grabbed people’s attention as a Turing complete smart contract platform. The runtime environment for Ethereum smart contracts is Ethereum Virtual Machine or EVM. Infinite loops held possible threats for the network so to mitigate it, the concept of gas was introduced. EVM needs gas, just like a car needs fuel to operate. Ethereum transactions require fees to use computational resources. This fee is paid in Eth. Gas prices are denoted in 10**-9 Eth i.e. 1 Gwei.
Each of the EVM opcodes has a fixed gas price.
Some of the initial gas costs are repriced in hard forks, and further can be repriced if deemed useful in future EIPs.
The value of the gas prices were decided during the initial design of the EVM. And based upon the frequency of the usage of the opcodes, the numbers were decided.
Gas metering offers a 15000 gas refund if the storage slot acquires a new value which is 0. While self-destructing a contract refunds 24000 gas. This brought forward the creation of gas tokens.
Gas tokens tokenize gas on Ethereum. It benefits from moving gas space i.e. “gasPrice” from a low-fee period to a high fee period. As the total fee is resulted from “gasPrice x gasUsed”. Reducing gasUsed causes lower total fees. Users could benefit from gas tokens by minting and burning their on-chain resources at the right time to pay less gas.
Gas tokens are ERC20 tokens with approve and Transfer From functionalities and can be called in multi-step transactions.
Gas tokens have two variations. GST1 is storage-based, it rewrites the storage value to gain refund whereas GST2 is contract-based which creates contracts that can be destructed later on via SELF_DESTRUCT refunding 24000 gas.
Chi Token is an ERC 20 token that is to be used in 1Inch. They can be referred as Gas tokens except with some improvements. The contract code makes it 1% more efficient when minting and 10% more efficient when it comes to freeing space. Chi token is pegged to Ethereum gas price. So, the price of Chi tokens is directly proportional to Ethereum gas price.
If Gas Tokens were so useful why didn’t every protocol use it?
The network faces a downside with the use of gas tokens, particularly in exacerbating state size and inefficiently clogging blockchain gas usage.
EIP-2200 proposed by Wei Teng in 2019, the gas metering for certain operators were re-structured in Istanbul Fork.
Later on EIP-2929 increased gas cost for SLOAD, *CALL, BALANCE, EXT* and SELF DESTRUCT when used for the first time in a transaction since these op codes were underpriced.
EIP 2200 proposes to add transaction-context-wide scope to differentiate between “cold” and “warm” state accesses, charging additional 2600 gas for a cold account or state access, and reducing the cost by 100 gas for a warm state storage access.
Charging COLD_SLOAD_COST for SSTORE_RESET_GAS, reduces the attractiveness, hence the usage of GST1.
GST1 weren’t commonly used because they were effective in smaller gasPrice ratio change.
As per Graph 1, GST1 were minted more in 2019, but aren’t really used to save gas (i.e. burned) except for October 2020. The minting decreased over time.
People turned to GST2 when Ethereum gas prices were taken to the moon last year as people were locking ETH in Ethereum 2.0. The same goes for Chi Tokens. (see graph 2 & 3)
Graph 2 clearly indicates the burning of GST2 from mid-2020 onwards, when gas prices were high for the reason of ETH locking. And in 2021, because of London Hard Fork. The same applies to Chi tokens as per Graph 3.
With the implementation of the London Fork, a few of the things were changed in Ethereum including the gas returns.
EIP-3529 removes the refunds for SELF_DESTRUCT. So the gas tokens depending on minting and destroying smart contracts are rendered useless as they use self-destruct to do so.
However, if the nodes do not update their EVM version and mines a gas token minting/burning transaction, gas refunds are possible. But as the block is propagated to the network, so there is less chance of an old block getting verified if the miners are upgraded to London Fork.
1 Wei Tang, (July, 18 2019), EIP-2200: Structured Definitions for Net Gas Metering. Retrieved from.
2 Vitalik Buterin, Martin Swende, (September, 01 2020), EIP-2929: Gas cost increases for state access opcodes. Retrieved from.
3 Vitalik Buterin, Martin Swende, (April, 22 2021), EIP-3529: Reduction in refunds. Retrieved from.