Cryptiqo

Financial Technology Blog

Gas is used to pay for Hedera Smart Contract Service transactions such as contract creation, smart contract function calls, and contract value returns. Gas represents the cost of the computational resources required to conduct transactions.

Gas fees

For all non-Hedera Service transactions, gas fees include the intrinsic gas cost and the cost of the EVM operation from the London gas schedule. This schedule has been modified from the London Gas Schedule. The cost of input data is added to the intrinsic gas cost per transaction, which is 21,000 (16 gas per non-zero byte and 4 gas per zero byte). Along with the intrinsic gas cost and EVM operation cost, an additional Hedera Service transaction gas fee will be assessed if your contract calls for Hedera Service transactions.

Total Gas (non-Hedera Service transaction) = Intrinsic Gas + EVM Operation Gas

Total Gas (Hedera Service transaction) = Intrinsic Gas + EVM Operation Gas + Hedera Service Gas

The native Hedera Service transaction price in USD is multiplied by the gas/USD conversion rate and a 20% surcharge to arrive at the Hedera Service transaction gas fee. A native token burn transaction, for instance, costs $0.001 USD. You would utilize the gas/USD conversion rate, which is 1 gas = $0.000 000 0569 USD. The total cost of gas would then be calculated by adding an additional 20% of gas.

You can multiply the amount of gas by the USD/gas conversion rate of $0.000 000 0569 USD per gas to determine the price of gas in USD. As an illustration, 2,000,000 gas costs $0.1138 (2,000,000 gas*$0.000 000 0569 USD/1 gas).

The USD/gas conversion rate for contract call transactions is $0.000 000 0852.

Gas per second throttling

The majority of Ethereum-based blockchains set a cap on the amount of gas that transactions can use per block. This limits the amount of time used for block validation so that the miner nodes can create new nodes more quickly. We are limited in how many blocks we can analyze by the mechanics of time even though it doesn’t have blocks or miners in the context of how a Nakamoto consensus system would use it.

Measuring the limitations on gas gives a more fair restriction on resource usage since, for smart contract transactions, gas is a better indicator of the complexity of the operation than counting all transactions equally.

The transaction limitations will be determined on a per-gas basis for smart contract calls in addition to a per-transaction limit in order to provide us greater flexibility in the transactions we accept and to mimic Ethereum Mainnet behaviour.

Gas reservation and unused gas refund

Prior to reaching an agreement, it throttles, and nodes have a cap on the number of transactions they can send to the network. The surplus transactions are not assessed and are cancelled in a busy state if the maximum number of transactions is then exceeded at consensus time. This system’s throttling by varying gas amounts presents certain difficulties because the nodes only submit a portion of their total transaction limit.

Throttling will be based on two different gas measures—pre-consensus and post-consensus—to remedy this. The gas limit will be used to gauge the throttle during pre-consensus throttling. Throttling applied post-consensus will be based on the actually evaluated transaction gas limit. Pre-consensus uses the gas limit field and will be referred to as the gas reserve because it is impossible to know the real evaluated gas pre-consensus because network status can directly affect how the transaction flows.

Maximum gas per transaction

It is now safe to increase the limit of gas accessible to each transaction because consensus time execution is now constrained by real gas spent rather than relying on a transaction count. Prior to the implementation of gas-based metering, it was theoretically conceivable for each transaction to consume the maximum amount of gas without regard to subsequent transactions, thus restrictions were set in accordance with this worst-case situation. We may let each transaction use big quantities of gas without worrying about a significant surge now that throttling is the total quantity of gas used.