Understanding Gas Fees on Hela
and Why Refunds on Failed Transactions Are a Big Deal
When people engage with blockchains, their attention often goes to the coins, the contracts, the outcomes. But underneath all that, something subtle yet essential is always in motion: gas.
Recently, Hela introduced a fundamental improvement to how gas fees work — one that not only corrects an old inefficiency but also significantly improves user experience. In this post, we’ll walk through what gas is, why it matters, how fees are calculated, and what Hela’s update has changed.
What are gas fees?
Gas is the computational cost of doing anything on a blockchain.
Whenever you perform an action whether it’s transferring tokens, interacting with a smart contract, or minting an NFT you’re asking the network to process your request. That processing power isn’t free. Gas is the unit that measures how much effort it takes to complete your action.
If you think of HeLa as a large computer network where people can do tasks like sending messages or running programs, gas is what keeps it running. Just like in the real world, these tasks require energy to get done.
Why do we need gas?
Gas is a critical element in keeping HeLa secure and processing transactions. Gas helps in many ways:
- Gas keeps HeLa sybil-resistant by preventing malicious actors from overwhelming the network with fraudulent activities.
- Because computation costs gas, spamming HeLa with expensive transactions, either accidentally and maliciously, is financially disincentivized.
- A hard-limit on the amount of computation that can be done at any one time prevents HeLa from being overwhelmed, helping to ensure the network is always accessible.
How Are Gas Fees Calculated on Hela?
On HelaChain, gas fees are calculated using a simple formula:
Total Gas Fee (HLUSD) = Gas Used × Gas Price
Here’s what each part means:
- Gas Used: The actual amount of gas consumed by your transaction.
- Gas Price: The cost you’re willing to pay per unit of gas, usually denominated in HLUSD.
- Gas Limit: A user-defined cap the maximum amount of gas you’re allowing your transaction to consume.
Calculate unuse gas: Unuse gas = Gas Limit – Gas Used
Create function refund unuse fee to sender: Unuse Fee = Unuse gas x Gas Price
Before a transaction is executed, you set a Gas Limit and a Gas Price. The chain deducts your total fee upfront based on that limit. After execution, if less gas was used, the difference (unused gas) is refunded.
What Was the Problem with Refunds Before?
Hela’s earlier fee model had an asymmetry:
- If your transaction succeeded, the unused gas was refunded as expected.
- But if your transaction failed, all the gas even the part that wasn’t used was retained by the network.
In other words, users were penalized for failed transactions, regardless of how much computation was actually consumed.
This introduced an unnecessary penalty for users, particularly developers and curious explorers testing decentralized applications. Even if only a small portion of the gas was used before the transaction failed, the entire allocated fee was consumed.
We knew this needed to change.
What’s New: Gas Refunds for Both Success and Failure
Our engineering team has implemented a key protocol improvement that ensures unused gas is now refunded even when a transaction fails.
This change brings the gas accounting model in line with what’s fair and efficient:
- The system now accurately tracks the gas actually used, whether a transaction succeeds or fails.
- Any remaining (unused) gas is refunded by multiplying it with the gas price.
- The refund is automatically credited back to the sender’s wallet.
This update brings symmetry and fairness to how gas fees are treated, success or failure, you only pay for the computation that was actually performed.
Currently, this improvement is live on our testnet, and we’re actively collecting feedback from developers and infrastructure providers. Following successful evaluation, we’ll deploy it to mainnet.
HeLa is still evolving, and how we treat the edges of the system often reveals how much we truly care about the people using it. This gas refund update is a small but significant move toward a better user experience on-chain.
If you’re a developer or curious explorer, we welcome you to test this on our testnet and share your insights. If you’re part of our community, know that updates like this are made with you in mind your safety, your fairness, your future.
Thank you for building Hela with us.