What is “Gas” in Ethereum?
Gas in Ethereum
Gas is the cost for creating a transaction or running a smart contract on the Ethereum blockchain. The cost varies depending on the computational effort. The formula for the transaction cost or “TX fee” is the Gas Price * Gas Limit. The TX fee is the primary method for which miners process smart contracts will get paid.
The Gas Price is the amount the person sets for transacting on the Ethereum blockchain. The Gas Limit is the amount the person will pay for the computation needed to execute the transaction on the blockchain.
For our example we will use the Ethereum unit of measure, Gwei , which is a smaller denomination of Ether, at 1X10-9 ETH. The smaller version of this is a wei, which is the smallest unit of Ethereum, at 1×10-18 ETH.
With a car, it’s $3.00 (price) per gallon (unit).
With Ethereum, it’s 30 GWEI (price) per gas (unit).
This unit is actually, units of Ethereum Virtual Machine (EVM) work. Each instruction sent to the EMV to process a transaction or smart contract will cost. If the required amount is not provided to the transaction, it will not complete. When someone is preparing to send a transaction, a “bid” on how much Ether is created for how much the person is willing to pay to process the smart contract or transaction.