Gas & Fees
Users need to pay a fee to submit transactions on the Areon. And it is important to understand how the Areon implements an Ethereum-type fee calculation.
Therefore this overview explains the basics of gas calculation, how to provide fees for transactions and how the Ethereum-type fee calculation uses a fee market (EIP1559) for prioritizing transactions.
If anyone can submit transactions to a network at no cost, the network can be overrun by a handful of actors sending large numbers of fraudulent transactions to clog up the network and stop it from working.
The solution to this is a concept called “gas," which is a resource consumed throughout transaction execution. In practice, a small amount of gas is spent on each step of code execution, thus effectively charging for use of a validator’s resources and preventing malicious actors from halting a network at will.
In general, gas is a unit that measures the computational intensity of a particular transaction — in other words, how much work would be required to evaluate and perform the job. Complex, multi-step transactions, such as a Areon transaction that delegates to a dozen validators, require more gas than simple, single-step transactions, such as a Areon transaction to send tokens to another address.
When referring to a transaction, “gas” refers to the total quantity of gas required for the transaction. For example, a transaction may require 300,000 units of gas to be executed.
Gas can be thought of as electricity (kWh) within a house or factory, or fuel for automobiles. The idea is that it costs something to get somewhere.
In general, there’s no way to know exactly how much gas a transaction will cost without simply running it. Otherwise, there are ways to estimate the amount of gas a transaction will require, based on the details of the transaction fields, and data. In the case of the EVM, for example, each bytecode operation has a corresponding amount of gas.
While gas refers to the computational work required for execution, fees refer to the amount you actually spend to execute the transaction. They are derived using the following formula:
Total Fee = Gas x Gas Price (the price per unit of gas)
If “gas” was measured in kWh, the “gas price” would be the rate (in dollars per kWh) determined by your energy provider, and the “fees” would be your bill. Just as with electricity, gas price is liable to fluctuate over a given day, depending on network traffic.
Fees on Ethereum include multiple implementations that were introduced over time.
Originally, a user would specify a GasPrice and GasLimit within a transaction—much like a Areon transaction. A block proposer would receive the entire gas fee from each transaction in the block, and they would select transactions to include accordingly.
With proposal EIP-1559 and the London Hard fork, gas calculation changed. The GasPrice from above has now been split into two separate components: a BaseFee and PriorityFee. The BaseFee is calculated automatically based on the block size and is burned once the block is mined. The PriorityFee goes to the proposer and represents a tip, or an incentive for a proposer to include the transaction in a block.
Gas Price = Base Fee + Priority Fee