Head of Development
LeadCoin Launches the Gas Crusher Version 1.0 - Saves Users 85% on ETH Transaction Fees
Big news here at LeadCoin! Our developers have launched the Gas Crusher v1.0, an open source, smart contract that’s free for everyone to use and can save you lots of money by significantly reducing batch transaction fees.
When designing our platform, I knew that we had to create a system that will support transferring loads of leads and LDC tokens to many people. One of the challenges we have to solve is the cost of the gas fees. Every transaction on the Ethereum blockchain requires paying a fee, and the fee goes directly to the miner. By the way, anyone can be a miner, so if you’re lucky or have enough computing power you can get the fee. The fee is calculated by the gas used for making the transaction multiplied by the gas price. And then it’s like an auction. Whoever sets the highest rate will enter the Ethereum blockchain first.
We know that users can't wait when they want to buy leads, so we wish to create a platform where our users will be able to purchase hot leads while paying the lowest possible fee. We know that our system should support transferring LDC tokens in real-time to many users, and we have been trying to find a way to reduce the costs for LDC token holders.
To that end, we have developed a smart contract that lets us send tokens to hundreds of users, for a much lower fee, by reducing the amount of computing power that’s needed for each transaction. After successfully testing the mechanism in Ethereum’s testnet, we deployed it to the real Ethereum blockchain. Last week, we used it to deliver the bounty tokens to our users, and the system works great! This is another significant step in our development.
A screenshot of the Gas Crusher’s transactions in action.
Each transaction on the blockchain uses gas. For a simple Ethereum token transfer between personal wallets (non-smart contract), the gas needed is 21,000. Then you can specify your gas price. For instance, if you choose 15 Gwei, your transaction will cost the gas needed times the cost per gas unit, meaning 315,000 Gwei or 0.000315 Ether (~$0.15).
This is for a regular Ethereum transfer. When transferring tokens, the gas amount is actually higher, at about 50,000 gas units for transferring to a new wallet. The reason is that creating a new wallet requires new memory on the blockchain, and memory costs an additional fee.
So there are two ways of reducing transaction costs:
1. Choose a lower gas price
2. Find a way to reduce the amount of gas units needed for each transfer
When you choose a lower gas price, e.g. 7 Gwei, when the Ethereum network is busy (as has been the case lately), it can take several hours to enter a block, and you must wait for the transaction to enter a block before submitting a new transaction. Ethereum does not support parallel transactions from the same wallet. In our case, we had to transfer tokens to 520 bounty winners. So it could have taken 4 hours * 520 transactions = almost three months; way too long. So if you don’t want to wait so long when the network is busy, you need increase the gas price to about 40 Gwei.
Instead, we developed a new smart contract, which supports transferring tokens to an almost unlimited number of users in one transaction. Then we transferred all the tokens to the new smart contract and executed all the transactions at once for one low gas price 7Gwei . When the block entered the blockchain, all the transactions came together in one piece, taking only 35,000 gas units per transfer, and we only had to wait two hours instead of three months.
To sum up, the regular price would have been 50,000 gas units * 40 Gwei * 520 = 1.04 Ether, which would allow us to make 520 transactions in a couple of hours over a busy network.
Instead we paid: 35,000 gas units per transfer * 7 Gwei * 520 = 0.1274 Ether in one transaction, saving over 85% in gas fees!