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 sub-units of the cryptocurrency ether, known as gwei, the gas is used to allocate resources of the ethereum virtual machine (EVM) so that decentralized applications such as smart contracts can self-execute is a secured fashion.
The exact price of the gas is determined by the network's miners, who can decline to process a transaction if the gas price does not meet their threshold.
- On the ethereum blockchain, gas refers to the cost necessary to perform a transaction on the network.
- Miners set the price of gas and can decline to process a transaction if it does not meet their price threshold.
- Gas prices are denoted in gwei, with are worth 0.000000001 ether.
- Having a separate unit allows maintaining a distinction between the actual valuation of the cryptocurrency, and the computational cost.
Understanding Gas in Ethereum
The concept of gas was introduced to keep a distinct value that solely indicates the consumption toward computational expenses on the Ethereum network. Having a separate unit allows maintaining a distinction between the actual valuation of the cryptocurrency, and the computational cost. Here, gas refers to Ethereum network transaction fees, not the gasoline for your car.
Gas fees in gwei 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 ether 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 ether (X), and the gas price to process this transaction at that particular time might be, say, 1/100,000 ether (Y).
Ethereum miners, who perform all the important tasks of verifying and processing a transaction, are awarded this particular fee for their computational services. If the gas price limit is too low, miners can choose to ignore such transactions.
The Ethereum Virtual Machine
The Ethereum Virtual Machine (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.
Currently, the EVM is in its infancy, and running smart contracts is both “expensive” in terms of ether consumed, as well as limited in its processing power. According to its developers, the system is currently about as powerful as a late 1990s-era mobile phone. This, however, is likely to change as the protocol is developed further. To put this into perspective, the computer on the Apollo 11 lander had less power than a first-generation iPhone; it is certainly plausible that in a few short years, the EVM (or something like it) will be able to handle sophisticated smart contracts in real time.
Within the Ethereum ecosystem, ether exists as the internal cryptocurrency, which is used to settle the outcomes of smart contracts executed within the protocol. Ether can be mined for and traded on cryptocurrency exchanges with bitcoin or fiat currencies such as US dollars and is also used to pay for computational effort employed by nodes on its blockchain.