Blockchain & Cryptocurrency Glossary

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

  • search-icon Clear Definitions
  • search-icon Practical
  • search-icon Technical
  • search-icon Related Terms

Gas

Pronunciation
[gas]
Analogy
Gas works like the fuel for your car—different operations (like driving uphill or on flat ground) require different amounts of fuel. Similarly, different blockchain operations (like simple transfers or complex smart contract functions) require different amounts of gas to execute. You pay for the exact amount of computational resources you use.
Definition
A unit that measures the computational effort required to execute operations on blockchain networks like Ethereum. Gas is used to calculate the fees that users must pay to process transactions or run smart contracts.
Key Points Intro
Gas is the resource accounting system that enables fair pricing of blockchain computations.
Key Points

Represents computational resources needed for blockchain operations.

Prevents spam and infinite loops by putting a cost on every operation.

More complex operations require more gas than simple ones.

Total transaction fee = gas used × gas price.

Example
When deploying a new smart contract on Ethereum, you might need 2 million gas units because it's a complex operation, while a simple ETH transfer typically requires only 21,000 gas units.
Technical Deep Dive
In Ethereum, every operation has a predefined gas cost: adding two numbers costs 3 gas, storing a word in contract memory costs 20 gas, sending a transaction costs 21,000 base gas, etc. These costs are set in the protocol based on the computational, bandwidth, and storage resources required. When submitting a transaction, users specify a gas limit (maximum they're willing to use) and a gas price (what they'll pay per unit). If a transaction runs out of gas during execution, it reverts, the state changes are rolled back, but the gas used is still paid to the validators who processed the failed attempt.
Security Warning
Setting a gas limit too low can cause transactions to fail after consuming (and charging for) the available gas. Conversely, complex smart contract interactions should include sufficient gas limit headroom to prevent expensive failures.
Caveat
The gas system is primarily used in Ethereum and compatible blockchains. Other blockchain platforms may use different resource accounting mechanisms, like 'energy' in TRON or 'bandwidth and CPU' in EOS.

Gas - Related Articles

No related articles for this term.