November 24, 2020

Gas Tokens Explained

Danial Ansari

Introduction

If you are an active ethereum user, you may be aware that the ethereum network suffers from serious scalability issues. This issue arises from time to time. Users face issues regarding high gas prices. Either it makes people wait for the gas prices to get lower causing significant delays in their daily businesses. Or, people settle for the current gas price which may cost them several times more than it would usually do.
Over the years, many scalability solutions have come forth. Some examples are off-Chain transactions, State Channels, ZK Proofs, and of course our main discussion today, Gas tokens. Just like all the other mentioned solutions gas tokens aim to help us with executing transactions cheaply despite the high gas price. 

What are Gas Tokens?

So if you are not aware, for using smart contracts, you use resources. These resources include storage, memory, and other deployed smart contracts provided by the EVM to build your logic onto the ethereum network. You pay gas for these resources. If you were to forfeit these resources, the gas you paid for is refunded back to you. 

Gas tokens basically refer to these types of resources when they are solely utilized to be forfeited at a later time to receive gas. This can be used to receive a discount when executing a transaction.
Not all gas tokens function the same. In fact, gas tokens can further fall into 2 categories.

GST 1:

Gas tokens which provide discount through the destruction of on-chain storage.

GST 2:

Gas tokens provide a discount through the destruction of deployed contracts like ERC20 tokens.

Now we will go through how exactly gas tokens work.

How do they work?

So as explained above gas tokens revolve around the concept of burning and minting your on-chain resources at the right time to receive maximum discount. Keeping this in mind let’s consider the following scenario 

  • You stored 20 words of data in your smart contract at a low gas price of 20 GWEI. You had to pay gas according to your storage and current gas price which would be a bit lower given the gas price.
  • Now sometime later the gas price has increased to 300GWEI. The storage that you had to pay for is now worth much more given the higher gas price.
  • Therefore, if you were to empty your storage now you will be paid back with a higher amount of gas than you paid for initially. This gives you a profit.
  • This, however, is only compensated as a discount since you are being paid with gas, not ether. So the gas you earned can be used for another task you are executing.
  • This procedure may give you a significant discount depending on the difference between the gas price when minting your on-chain assets and the gas price when burning your on-chain assets.

Therefore knowing when to mint and when to burn your resources is key to acquiring maximum discount on your transactions. You need to have a good look at what the current gas price is. Please note that if you are creating and destroying your gas tokens at the same gas price you will get no discount and instead will make your transaction slightly more expensive.

GST 1 VS GST 2:

So now that we know what are gas tokens and also the two types of gas tokens, let’s compare them with each other to see which one is better

Both do their work well and can provide you with a significant discount. However, in GST1 you are limited to how many smart contract variables and assets you have, you would have to store data in them when gas prices are low and empty them when gas prices are high. If you have 5 such storage variables you will be limited to the discount those 5 can provide you with. On the other hand, GST2 can utilize ERC20 tokens. You may mint as many tokens as you wish and use them to get the maximum discount they can offer. There are specific tokens made for such purposes. The most famous of them being CHI tokens.

The following chart displays statistics based on the performance of the 2 types of gas tokens. 

Given the above information GST2 tokens though more expensive, will provide you with much more discount as compared to GST1. 

CHI Tokens:

These tokens are GST2 gas tokens created by 1Inch. They are the most popular application of gas tokens. Chi tokens act like normal ERC20 tokens(which are fungible tokens widely used in the ethereum network) which you can easily mint and transfer using their smart contract.
The official Chi tokens contract is only deployed on the mainnet.

You can easily utilize Chi tokens in your smart contract by importing the Chi tokens smart contract and using the discountChi modifier on the function you want a discount on. Of course, you will need to give approval to your smart contract before you can utilize them.

If you are wondering where you can get some CHI tokens to get some discount there are 2 ways of doing it.
1) The first way of getting some CHI token is by minting it to your account using the verified smart contract deployed on the mainnet.

If you choose to mint Chi tokens from here , you will be charged transaction fee according to the current gas price.

2) The other way of getting some CHI tokens is by purchasing them from the 1Inch Exchange.

Conclusion:

Compared to other scalability solutions, gas tokens are probably the most simple to use and easily accessible solutions for a cheap transaction. So to sum up, gas tokens are easy to use, easy to get, and have the potential of making your transaction unfairly cheap. 

Also read Blockchain Scalability: Limitations and Solutions

Xord is a Blockchain development company providing Blockchain solutions to your business processes. Connect with us for your projects and free Blockchain consultation at https://xord.solutions/contact/

Share:

We develop cutting-edge products for the Web3 ecosystem supported by our extensive research on blockchain core and infrastructure.

Write-Ups
About Xord
Companies
Community
© 2023 | All Rights Reserved
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram