Skip to content
Blockchain

Gas

Unidade que mede o esforço computacional de uma operação em uma blockchain e determina a taxa paga para que ela seja processada e validada pela rede.

Key points

  • Gas is the measure of computational effort required to execute an operation on a blockchain, and it is what defines the fee paid for the transaction.
  • The more complex the operation, the more gas it consumes, so a simple transfer costs less than executing an elaborate smart contract.
  • The price of gas varies with network demand: when many users compete for space, the cost per operation rises.

What is gas?

Gas is the pricing mechanism that calculates the cost of operations and transactions on networks such as those compatible with the Ethereum Virtual Machine. Each instruction executed consumes an amount of gas, and the total defines how much the user pays for the network to process their transaction. It is the way of compensating those who validate operations and of protecting the network against abuse.

How it works

A transaction sets a gas limit, which is the maximum amount the user agrees to spend, and a price per unit, usually measured in gwei, a small fraction of the native asset. The final cost is the amount of gas actually consumed multiplied by the unit price. If the operation requires more gas than the defined limit, it fails and the amount spent up to that point is not refunded.

The price per unit fluctuates according to competition for block space. During periods of high demand, users offer higher prices to get priority, and the cost rises. During calmer periods, the same type of operation is cheaper. That is why the time of day and the chosen network directly affect how much is paid.

Heavier operations, such as interacting with complex smart contracts, consume much more gas than a direct transfer between addresses.

Why it matters

Understanding gas helps predict and reduce costs when operating on-chain. For a company processing many transactions, choosing low-cost networks and times of lower congestion has a direct impact on expenses. It is also because of gas that cheaper networks have become attractive for payments at scale, since a high fee can exceed the value of a small transfer and make commercial use unfeasible.

Limitations

The cost in gas is unpredictable on heavily congested networks, which makes it difficult to estimate expenses precisely. Congestion spikes can make small operations economically unviable for a period of time. Each network has its own price dynamics, so the same operation can have very different costs depending on where it is carried out.