Lesson 2: Walking the Blockchain (Ethereum Transactions, Blocks and Gas)
Today we meditate on the movement of the chain itself: the pulse, the footsteps, the breathing of Ethereum. If we want to monitor its threats, we must first understand its rhythms.
So let’s go step-by-step into the world of Ethereum transactions, blocks, and gas.
What Is Ethereum, Really?
Ethereum is not just a cryptocurrency.
It is:
A global state machine
A virtual computer that anyone can use
A ledger of programmable agreements (smart contracts)
Imagine Ethereum as a public spreadsheet combined with a programmable vending machine:
It records who owns what
It lets you run code that anyone can verify
But every operation has a price
That price is gas, and we’ll get to that shortly.
What Is a Transaction?
A transaction (tx) is a request sent to the Ethereum network to:
Send ETH or tokens
Call a function in a smart contract
Deploy a new smart contract
It’s like sending a letter:
You write the message (data + destination)
You stamp it (sign it with your private key)
You send it into the post office (Ethereum mempool)
Structure of a Transaction
What Is a Block?
A block is a bundle of transactions grouped together and added to the chain.
It contains:
A list of transactions
A timestamp
The miner/validator who added it
The gas used
A unique hash (fingerprint)
A block is like a sealed envelope filled with letters that got processed that minute.
What Is Gas?
Gas is the fuel used to run operations on the Ethereum network and other networks.
Every instruction (like adding two numbers or storing a variable) costs gas. This prevents spam and ensures users pay for computation.
Example:
Storing a number : 20,000 gas
Sending ETH: 21,000 gas
Writing to storage: 45,000+ gas
If you don’t provide enough gas then your transaction fails.
Think of gas like gasoline. You tell the car (Ethereum): "Drive me to London." If you don’t give it enough fuel, it breaks down halfway.
How Do You Pay for Gas?
You pay gas using ETH.
Total fee = gasUsed × gasPrice
If the gas price is 100 gwei and you use 21,000 gas, the fee = 0.0021 ETH.
Gas prices fluctuate like Uber surge pricing. When the network is busy, prices go up.
Understanding the Mempool
When you submit a tx, it goes to a waiting area called the mempool.
Validators pick transactions from the mempool based on:
Gas price (higher is better)
Ordering (who came first)
Imagine a crowded club with a bouncer. The more gas you pay, the faster you get in.
Why is important for Blockchain Monitoring
When building Forta bots, you often work with:
Transactions (
handleTransaction
)Events emitted by smart contracts
Gas used (to spot abnormal usage)
Pending txs (mempool bots to detect potential attacks)
You must understand how these flow through Ethereum so your bots can intercept, analyze, and alert on them properly.
A security monk cannot guard the gates if he doesn’t understand who walks through them and how they pay their toll.
Practice Activity
Use etherscan.io:
Find a recent block
Click into a transaction
Identify:
Sender and receiver
Gas used
Function called
Events emitted (look in Logs)
Bonus: Paste the tx hash into Tenderly and simulate its execution.
Why This Lesson Matters in Blockchain Security Monitoring
To monitor the blockchain:
You must know what you're observing
You must understand the structure of the threat
You must decode where and how it happened
Understanding blocks, transactions, and gas helps you:
Detect anomalies (e.g., someone using 1 million gas for a simple call?)
Track attacker behavior across transactions
Write smarter detection logic in Forta
Every Forta bot you build will interact with this system. So walk the chain with awareness.
🙏 Until next meditation,
The Blockchain Security Monk