What is "Gas" - Crypto Whiteboard 101

Do repost and rate:

Over the past few months, one of the most popular phrases in the cryptocurrency world is that "gas prices are so high." If you're new to cryptocurrency, you might be confused as to what "gas" actually is, and why it matters. In this article, I will briefly explain the role that gas plays within the Ethereum ecosystem as well as discussing the differences between and gas price.

Gas Explained

To start off with, it's important to understand that any transfer of cryptocurrency requires computational power to process and verify the transaction. Obviously, processing and verifying a transaction requires electricity as well as having powerful computer hardware so some kind of "fuel" is necessary. Gas, therefore, refers to the amount of computational power that is needed to process a certain type of transaction on the blockchain. Different operations require different amounts of "gas", but the amount of gas needed for a specific operation always remains fixed.

To help make this a little bit clearer, let me give an example. Suppose that you have a car that averages 30 miles per gallon and you want to take a trip for 30 miles. You know that you will need exactly one gallon of gas to complete this trip. No matter how many times you take this trip, you will always need the same quantity of one gallon of gas to complete it (assume the car maintains the same level of fuel efficiency). The same is true when we talk about gas on the Ethereum blockchain. Just remember that the amount of gas needed to process a transaction is fixed. 

 

Gas Price / Gwei Explained

Although the amount of gas required to complete a certain operation remains fixed, the price necessary to purchase that gas can fluctuate. This is the exact same as the price of gas/petrol in the real world. Every time we take our 30 mile trip in our car that gets 30 miles per gallon we will need to purchase one gallon of gas. The actual quantity of gas remains the same, but some days the price of gas may be more or less expensive. One day the trip may cost $1.87 if the price of gas is low, and another day it might cost $3.50 if the price of gas is higher. The key takeaway here is that even though the amount of gas is fixed, the total transaction cost can still change day-to-day based on the price of the gas.

The Ethereum world is different from purchasing gas at a real-world gas station because users have the ability to specify how much they want to pay for each unit of gas. For example, let's suppose that I have a transaction that requires a gas amount of 142020. That amount is fixed, however, I can specify any price that I am willing to pay. At first, you might be tempted to think that it's best to simply select the lowest gas price for every transaction, however, there's a catch to that. While users set the gas price they are willing to pay, the miners decide which transactions they are willing to accept. From a simple business perspective, it's easy to see that transactions with the highest gas price will be more attractive to the miners and therefore processed more quickly. Transactions with a lower gas price will be processed slowly, or in extreme cases, might not even be accepted by the network at all.

Thus, selecting the appropriate gas price is a trade-off between the total transaction cost and the speed at which the transaction is accepted and processed by the network. Although users are free to select whatever gas price they want, gas prices that fall below the "safe low" amount have an increased risk of not being accepted by the miners and failing to process. Before making a transaction, it's always a good idea to check the safe low gas price on ETH Gas Station to make sure that your transaction has sufficient gas price to be accepted by the network.

An interesting fact is that gas on the Ethereum network isn't denominated in Dollars, Pounds, or Yen. Rather, it is denominated in its own unique unit called gwei, but if that is confusing, it's perfectly fine to simply call it the "gas price" as both terms mean the same thing. 

Summary

In summary, gas is simply the fuel that is required to carry out transactions on the Ethereum network. Different types of transactions require a different amount of computational power, and therefore, more gas. Although users can't control the amount of gas needed to carry out a transaction, they can control the price they are willing to pay for that said gas (gwie). Paying a higher amount of gas ensures that the transaction will be processed more quickly, but a lower gas price will likely result in a slower transaction. The total cost for a transaction depends on both the amount of gas used as well as the cost of the gas.

I know that understanding the difference between gas and gas price was confusing when I started out, so I hope this article helps a little bit of the confusion. Thanks for reading!

References:

https://ethereum.github.io/yellowpaper/paper.pdf

Image Credits

https://freesvg.org/

 

 

 

Regulation and Society adoption

Ждем новостей

Нет новых страниц

Следующая новость