Table of Contents
![Blog post image.](https://bnbchain.ghost.io/content/images/2024/06/wide--13-.png)
Gwei is a unit for measuring gas fees in smart contract platforms, providing precise and standardized fee calculations. BNB Chain’s low gas fees make it highly affordable.
What is Gwei? It is short for “gigawei,” is a unit of measure for gas fees in smart contract platforms. The term “giga” signifies a billion, while “wei” is the smallest fraction of gas fees, named after Wei Dai, a prominent figure in cryptography. Thus, Gwei combines these concepts to literally mean a “billion wei.”
Gas is a fundamental element of smart contract platforms, serving as the fee required to conduct transactions or execute contracts. These fees compensate validators for the computational resources they expend during these operations. This system rewards validators, who maintain and secure the blockchain for their essential work in addition to the block rewards they receive.
How Does Gas Work?
Let’s examine what happens specifically in BNB Smart Chain (BSC). As you may know, BSC is an EVM-compatible blockchain. EVM, or Ethereum Virtual Machine, is the execution engine for smart contracts and Dapps on networks like BNB Chain and Ethereum. To execute your smart contract, you must run it in the EVM.
When a transaction or smart contract is initiated, the EVM loads with the transaction data and a specified amount of gas. As operations are performed, the gas amount decreases. If the gas depletes before the transaction completes, the transaction is halted and considered invalid, though fees are still paid for the computational efforts up to that point.
Gas fees fluctuate based on network congestion—rising with high demand and falling with low traffic. Additionally, smart contracts can call other contracts, each loading a new EVM instance with inherited data. If gas runs out during these operations, the state reverts to before the transaction attempt.
Transactions on these platforms require computational effort, which is compensated through gas fees. These fees are paid in the platform’s native cryptocurrency but are often expressed in smaller units like gwei for easier calculation and understanding.
Gas Limit vs Gas Price vs Gas Fees
Before we proceed, let’s clarify some basics and understand the difference between gas limit, gas price, and gas fee.
- Gas Limit: The maximum amount of computational effort you are willing to allocate for a transaction.
- Gas Price: The fee per unit of computational effort you are willing to pay to prioritize your transaction.
- Gas Fee: The total cost paid for executing a transaction, determined by the gas used and the gas price.
What is Gwei? Why Do We Use it?
Using a measurement like Gwei instead offers several advantages:
- Precision: Gwei provides a more precise way to calculate and represent small transaction fees, which would otherwise require lengthy decimal places in ether.
- Simplicity: It simplifies the understanding and communication of gas prices among users and developers.
- Standardization: Gwei has become the standard unit for expressing gas fees, making it a familiar and convenient measure within the crypto community.
Other Denominations
As mentioned before, “wei” is the smallest unit of measurement. Since it was originally designed for Ethereum, 1 wei is equivalent to 0.000000000000000001 ETH. The following are the other denominations used. Each denomination is named after influential figures in the fields of cryptography and computing, honoring their contributions to the development of digital currencies and blockchain technology.
Measurement | Honoring | Value |
Kwei | Charles Babbage | 1,000 wei |
Mwei | Ada Lovelace | 1,000,000 wei |
Gwei | Claude Shannon | 1,000,000,000 wei |
Twei | Nick Szabo | 1,000,000,000,000 wei |
Pwei | Hal Finney | 1,000,000,000,000,000 wei |
Gas In BNB Chain
BNB Chain’s L1 (BSC) and L2 (opBNB) platforms are extremely affordable due to their low gas fees.
BSC Gas
BSC has the lowest gas price among L1s, with <$0.03. The average gas fee charged is currently at ~3 Gwei. To make the network even more affordable, BSC has increased its gas limit to 140M gwei.
The block gas limit represents the highest amount of gas that can be consumed within a single block. If a smart contract function demands more gas than this limit to finish its execution, the transaction will not succeed.
By increasing the gas limit to 140M, BSC currently has 4.6 times the gas carrying capacity of Ethereum.
opBNB Gas
The gas fees on opBNB are almost negligible. Previously, they were $0.001, but they have been reduced almost tenfold to $0.0001. This significant reduction makes transactions on opBNB more cost-effective for users.
Additionally, the block carrying capacity is set to double from 100 million gas per block to 200 million gas per block, further enhancing affordability and efficiency.
A key feature of opBNB is its support for account abstraction (AA). With AA, applications can leverage opBNB’s optimized transaction processing to significantly reduce gas costs associated with complex operations and smart contract interactions. This means that users can enjoy gasless transactions without worrying about prohibitive costs, which is particularly beneficial for applications requiring a large number of microtransactions, such as gaming and high-frequency trading (HFT) DeFi apps.
Conclusion
Gas fees are essential for compensating validators on smart contract platforms. Gwei, a precise and standardized unit, is used to measure these fees. Both BSC and opBNB are designed to be affordable, charging minimal gas fees that benefit both developers and users.