What is Ethereum Gas? [The Most Comprehensive Step-By-Step Guide Ever!] - Deepstash
The Startup Masterclass

Learn more about crypto with this collection

How to start a successful business

How to build a strong team

How to market your business

The Startup Masterclass

Discover 160 similar ideas in

It takes just

25 mins to read

From Bitcoin to Smart Contracts

Bitcoin created a decentralized monetary system which can transfer money from one person to another. That only allowed for monetary transactions, there was no way to add conditions to those transactions:Ā 

Alice can send Bob 5 BTC, but she couldnā€™t tell Bob that he will get the money only if he performed certain tasks.

These conditions are a smart contract: self-executing with specific instructions written in its code which get executed when certain conditions are made.

Say Alice wants to buy a house. The seller will receive the funds only if property rights are cleared and after the rights have been transferred over.

53

470 reads

Ethereum Virtual Machine (EVM)

Ether is made of a blockchain (an immutable database) and a world decentralised computer (EVM), a virtual machine in which all the smart contracts function in Ethereum.Ā 

The EVM is a simple yet powerful Turing Complete 256-bit virtual machine. Turing Complete means that given the resources and memory, any program executed in the EVM can solve any problem.

43

192 reads

The attributes of a Smart Contract

The attributes of a Smart Contract

A smart contract functionality needs to be 3 things:Ā 

Deterministic: it gives the same output to a given input every single time.

Terminable: contracts by definition, must be capable of termination in a given time limit.

Isolated: a contract will be kept isolated in a sandbox to save the entire ecosystem from negative effects.Ā 

42

151 reads

Ethereum Gas

Gas is a unit that measures the amount of computational effort that it will take to execute certain operations. Each and every line of code in an Ethereum smart contract requires a certain amount of gas to be executed.

Suppose you are going on a road trip:

  • You go to the gas station & specify how much gas you want to fill up in your car.
  • You get that gas-filled up in your car.
  • You pay the gas station the amount of money you owe them for the gas.

In Ether world:

  • Driving the car is the smart contract.
  • The gas is wellā€¦.gas.
  • The gas station is your miner.
  • The paid money is miner fees.

41

141 reads

Purpose of Ethereum Gas system

Incentivization. Like any proof-of-work peer-to-peer system, Ethereum is heavily dependent on the computational power of its miners. More miners, more computational power, more secure and fast the system.

To attract more miners Ether needs to make the systemĀ as profitable and alluring as possible for the miners. In Ethereum, there are two ways that miners can earn money:

  • ByĀ miningĀ blocks and getting block rewards.
  • By running smart contracts. The gas system allows them to charge a certain fee for doing so.

40

109 reads

Ethereum as electricity

If bitcoin is digital gold, Ethereum is alike the power grid, powering an ecosystem of worldwide decentralized applications.Ā 

The gas is the metering system for the consumed power. And ETH is the currency used to pay for running the software and maintaining the network.Ā 

41

123 reads

Gas Limits & Gas Price

To get an operation done in Ethereum, the sender of the transaction must specify a gas limit before they submit it to the network & a gas price:Ā 

  • The gas limit is the maximum amount of gas the sender is willing to pay for this transaction. If an operation has LOW gas, then the miners wonā€™t even pick it up because it doesnā€™t have enough gas to finish the computation.
  • The price is the amount of gas the sender is willing to pay. If an operation has LOW fees, then it might have just enough gas to cover it but still, the miners wonā€™t be chomping at the bits to pick it up because an operation with low fees isnā€™t economically appealing for them.

41

93 reads

Ethereum Gas Refund

If an operation runs out of gas, then it is reverted back to its original state like nothing actually happened, however, the operation generator mustĀ STILL payĀ the miners the fee for their computational costs and theĀ operation gets added to the blockchain (even if it has not been executed).

40

84 reads

Ethereum Gas is EXPENSIVE

When two numbers are added a million times in Ethereum it costs ~$26.55 in fees. On Amazon AWS system it costs $0.000000066.

This means that computation in Ethereum is 400 million times more expensive!

However:

  • A well-written contract would likely move such computational complexity off-chain and deal more with updating state in the contract.
  • A well-written contract would likely move such computational complexity off-chain and deal more with updating state in the contract.

41

110 reads

CURATED BY

vladimir

Life-long learner. Passionate about leadership, entrepreneurship, philosophy, Buddhism & SF. Founder @deepstash.

stash-superman-illustration

Explore the Worldā€™s

Best Ideas

200,000+ ideas on pretty much any topic. Created by the smartest people around & well-organized so you can explore at will.

An Idea for Everything

Explore the biggest library of insights. And we've infused it with powerful filtering tools so you can easily find what you need.

Knowledge Library

Powerful Saving & Organizational Tools

Save ideas for later reading, for personalized stashes, or for remembering it later.

# Personal Growth

Take Your Ideas

Anywhere

Organize your ideas & listen on the go. And with Pro, there are no limits.

Listen on the go

Just press play and we take care of the words.

Never worry about spotty connections

No Internet access? No problem. Within the mobile app, all your ideas are available, even when offline.

Get Organized with Stashes

Ideas for your next work project? Quotes that inspire you? Put them in the right place so you never lose them.

Join

2 Million Stashers

4.8

5,740 Reviews

App Store

4.7

72,690 Reviews

Google Play

samz905

Donā€™t look further if you love learning new things. A refreshing concept that provides quick ideas for busy thought leaders.

ā€œ

Sean Green

Great interesting short snippets of informative articles. Highly recommended to anyone who loves information and lacks patience.

ā€œ

Shankul Varada

Best app ever! You heard it right. This app has helped me get back on my quest to get things done while equipping myself with knowledge everyday.

ā€œ

Ashley Anthony

This app is LOADED with RELEVANT, HELPFUL, AND EDUCATIONAL material. It is creatively intellectual, yet minimal enough to not overstimulate and create a learning block. I am exceptionally impressed with this app!

ā€œ

Jamyson Haug

Great for quick bits of information and interesting ideas around whatever topics you are interested in. Visually, it looks great as well.

ā€œ

Laetitia Berton

I have only been using it for a few days now, but I have found answers to questions I had never consciously formulated, or to problems I face everyday at work or at home. I wish I had found this earlier, highly recommended!

ā€œ

Giovanna Scalzone

Brilliant. It feels fresh and encouraging. So many interesting pieces of information that are just enough to absorb and apply. So happy I found this.

ā€œ

Ghazala Begum

Even five minutes a day will improve your thinking. I've come across new ideas and learnt to improve existing ways to become more motivated, confident and happier.

ā€œ

Read & Learn

20x Faster

without
deepstash

with
deepstash

with

deepstash

Access to 200,000+ ideas

ā€”

Access to the mobile app

ā€”

Unlimited idea saving & library

ā€”

ā€”

Unlimited history

ā€”

ā€”

Unlimited listening to ideas

ā€”

ā€”

Downloading & offline access

ā€”

ā€”

Personalized recommendations

ā€”

ā€”

Supercharge your mind with one idea per day

Enter your email and spend 1 minute every day to learn something new.

Email

I agree to receive email updates