BEVM Mainnet


In the BEVM network, every transaction requires the consumption of a certain amount of Gas. Gas is the fuel that powers the execution of transactions and smart contract operations on the BEVM network. Each operation has a fixed Gas consumption, which is defined by the rules of the Ethereum Virtual Machine (EVM). Understanding the Gas calculation of the BEVM is a key part of understanding how the BEVM network operates.

What is Gas?

Gas is the unit of measurement used to quantify the computational work and storage operations in the BEVM network. Whenever users want to execute a transaction or smart contract, they must specify a Gas Limit and Gas Price. The Gas Limit is the maximum amount of Gas that the user is willing to pay for the computation, while the Gas Price is the amount of BTC the user is willing to pay for each unit of Gas.

Standard Gas Calculations

In the BEVM network, transaction fees are composed of two parts: the base fee and the priority fee, also known as a tip.

The base fee is the minimum fee that must be paid for every block and is a dynamic value that adjusts automatically based on network congestion. Each block has a target size, and the base fee increases if the previous block exceeds this target size; it decreases if the block is below the target size. This mechanism is designed to help the network regulate itself and maintain stability in transaction fees.

The priority fee is an additional fee that users are willing to pay to miners to have their transactions prioritized. When the network is congested, miners may prefer transactions with higher priority fees because it allows them to earn more revenue. Therefore, if users want their transactions to be processed quickly, they can incentivize miners by increasing the priority fee.

In Solidity smart contracts, you can access the current block's base fee using block.basefee, but there is no direct way to set the priority fee. Instead, when users or applications initiate a transaction, they need to specify maxPriorityFeePerGas (the maximum priority fee) and maxFeePerGas (the maximum fee, including both the base and priority fees) in the transaction parameters. Miners consider these parameters when selecting transactions to include in a block.

Gas Limit and Gas Price

Users need to set a Gas Limit and Gas Price when sending transactions.

  • Gas Limit: This is the maximum total amount of Gas that the user is willing to pay for executing the transaction or contract operation. If the transaction consumes more Gas than the Gas Limit, the transaction will fail, and the consumed Gas will not be refunded.

  • Gas Price: This is the price that the user is willing to pay per unit of Gas. The higher the Gas Price, the higher the priority miners will give to processing the transaction.

Estimating Gas Costs

Most EVM wallets and clients automatically estimate the Gas required for a transaction. They usually take into account the current network congestion and the complexity of the transaction.

Last updated