# Gas and Blockspace
The question this note answers: what is the scarce resource in a blockchain, and how does it get priced?
The short version: blockspace is the commodity a blockchain sells, and gas is how it's metered. But it's worth seeing why metering had to exist at all.
## Why metering exists
Every node executes every transaction — that's the security model. Which means that without some cost attached, anyone could submit:
```solidity
while (true) {}
```
and every node in the network would grind to a halt trying to run it. Gas turns computation into a bounded, paid resource. A transaction declares up front:
```text
gas_limit // the most work it may consume
max_fee // the most it will pay per unit
priority_fee // the tip to the block producer
```
If execution runs out of gas midway, the state changes revert — but the fee is still paid. That might feel harsh, but consider the alternative: if failed transactions were free, attacks would be free too. Work was done; work gets charged.
## What gas prices
Gas isn't just CPU time. It prices everything that's scarce in the system:
- Computation
- Storage (the expensive one — every node keeps it, forever)
- Data published in blocks
- Blockspace itself
A database analogy that holds up well: a blockchain is a database where every write is replicated to every node indefinitely, and the write queue is auctioned to the highest bidder. Fees are what an adversarial system uses where a friendly system would use admission control.
## The market
Blocks are finite; demand isn't. So blockspace clears the way scarce things usually do — by auction. Base fees, priority fees, and, once ordering itself becomes valuable, [[MEV]].
When you hear "gas is high," you can translate: demand for this chain's blockspace currently exceeds supply. And that translation explains a lot of the industry's roadmap — scaling ([[09 Scaling - Rollups and Data Availability]]) is largely the project of manufacturing cheaper blockspace without weakening verification.
## Where this matters
- [[05 Execution and Smart Contracts]] — gas as the execution governor
- [[06 Transaction Lifecycle and MEV]] — fees as the mempool's sorting function
- [[09 Scaling - Rollups and Data Availability]] — blobs as discounted blockspace for data