What Is Gas (Ethereum)?
Gas refers to the fee, or pricing value, required to successfully conduct a transaction or execute a contract on the Ethereum blockchain platform. Priced in small fractions of the cryptocurrency ether (ETH), commonly referred to as gwei and sometimes also called nanoeth, the gas is used to allocate resources of the Ethereum virtual machine (EVM) so that decentralized applications such as smart contracts can self-execute in a secured but decentralized fashion.
The exact price of the gas is determined by supply and demand between the network's miners, who can decline to process a transaction if the gas price does not meet their threshold, and users of the network who seek processing power.
- On the Ethereum blockchain, gas refers to the cost necessary to perform a transaction on the network.
- Miners set the price of gas based on supply and demand for the computational power of the network needed to process smart contracts and other transactions.
- Gas prices are denoted in small fractions of ether called gwei.
- The value of gas for internal processing, which is distinct from how ether tokens value the actual valuation of the cryptocurrency, disaggregates the value layer and the processing layer of the Ethereum platform.
Understanding Gas in Ethereum
The concept of gas was introduced to maintain a distinct value layer that solely indicates the consumption toward computational expenses on the Ethereum network. Having a separate unit for this purpose allows for a practical distinction between the actual valuation of the cryptocurrency (ETH), and the computational cost of using Ethereum's virtual machine (EVM). Here, gas refers to Ethereum network transaction fees, not the gasoline for your car.
Gas fees are payments made by users to compensate for the computing energy required to process and validate transactions on the Ethereum blockchain. "Gas limit" refers to the maximum amount of gas (or energy) that you're willing to spend on a particular transaction. A higher gas limit means that you must do more work to execute a transaction using ETH or a smart contract.
To draw an analogy, running a real-world car for X miles may require Y gallons of fuel, or moving X amount of money from your bank account to your friend’s credit card account may cost you Y dollars in a processing fee. In both cases, X indicates the utility value, while Y indicates the cost of performing the process of the car trip or financial transaction.
Similarly, a contract or transaction on Ethereum may be worth 50 ETH (X), and the gas price to process this transaction at that particular time might be, say, 1/100,000 ETH (Y).
Ethereum miners, who perform all the important tasks of verifying and processing transactions on the network, are awarded this particular fee in return for their computational services. If the gas price limit is too low, miners can choose to ignore such transactions. As such, the price of gas fluctuates (priced in ETH) with supply and demand for processing power.
The Ethereum Virtual Machine (EVM)
The EVM is capable of running smart contracts that can represent financial agreements such as options contracts, swaps, or coupon-paying bonds. It can also be used to execute bets and wagers, to fulfill employment contracts, to act as a trusted escrow for the purchase of high-value items, and to maintain a legitimate decentralized gambling facility. These are just a few examples of what is possible with smart contracts, and the potential to replace all sorts of legal, financial, and social agreements is exciting.
Within the Ethereum ecosystem, ETH exists as the internal cryptocurrency, which is used to settle the outcomes of smart contracts executed within the protocol. ETH can be mined for and traded on cryptocurrency exchanges with bitcoin or fiat currencies such as U.S. dollars and is also used to pay for computational effort employed by nodes on its blockchain.
Soon, however, Ethereum plans to move to a Proof of Stake (PoS) based blockchain. In this model, miners would no longer exert computational power, but instead rely on a consensus model according to how many coins a node holds.