Section 01 · What a Transaction Is
A transaction is a signed message, not a payment
Most people picture a transaction as money moving. On Ethereum it is closer to a contract: a signed instruction telling the network to update its state in a specific way.
Quick answer
What is an Ethereum transaction? An Ethereum transaction is a cryptographically signed message that asks the network to update its global state. It can move ETH from one address to another, transfer a token, deploy a smart contract, or call a function on an existing one. Once a validator includes it in a block and the EVM executes it, the result is permanent and visible to every node.
Every action you take on chain is a transaction. Sending one stablecoin is a transaction. Minting an NFT is a transaction. Approving Uniswap to spend your USDC is a transaction. Even deploying a smart contract is just a transaction whose data field is the contract bytecode and whose to field is empty.
What makes a transaction valid is not the intent. It is the signature. A node that receives a transaction reconstructs the address that signed it from the signature itself, then checks that address against the from field. If it matches, the network agrees that whoever holds the private key authorized the action. If it does not match, the transaction is rejected before anyone wastes a block on it.
Section 02 · The Fields
The seven fields inside every transaction
A modern Ethereum transaction (EIP 1559) has seven fields plus the signature. Each one has a job.
from
The sender's address. Not actually sent over the wire as a separate field. The network recovers it from the signature, which means you cannot forge it. The fee for the transaction is deducted from this address's ETH balance.
to
The recipient. Either an externally owned account (a regular wallet address) or a contract address. If the to field is empty, the transaction is a contract deployment and the data field carries the new contract's bytecode.
value
How much ETH to send, denominated in wei (1 ETH equals 10 to the 18 wei). Can be zero, which is normal for token transfers and contract calls where the value being moved lives inside the contract's storage, not in ETH.
data
Arbitrary bytes. For a plain ETH transfer it is empty. For a contract call it is the function selector (the first four bytes of the keccak256 hash of the function signature) followed by ABI encoded arguments. For a deployment it is the bytecode.
nonce
A counter unique to the sender's address. Every new transaction from an address increments by one. The nonce prevents replay attacks (you cannot replay an old transaction because its nonce is now stale) and forces transactions to execute in order. A stuck nonce is the most common reason a transaction sits in the mempool forever.
gas limit
The maximum amount of computational work the transaction is allowed to perform. If the EVM exceeds this limit during execution, the transaction reverts but the validator still keeps the gas paid. Set too low, the transaction fails. Set too high, you waste no money (unused gas is refunded) but the wallet temporarily reserves the maximum amount.
fee fields (maxFeePerGas, maxPriorityFeePerGas)
The EIP 1559 fee market. maxPriorityFeePerGas is the tip you pay the validator who includes your transaction. maxFeePerGas is the absolute ceiling, including the network's base fee. The actual fee paid is gas used times (current base fee plus priority tip), capped at maxFeePerGas. The base fee is burned, not paid to anyone.
Section 03 · The Lifecycle
From wallet click to confirmed block
A transaction passes through six clearly separated stages. Knowing where yours is right now is the difference between waiting another 12 seconds and waiting forever.
Stage one is in your wallet. The wallet pulls the current nonce for your address, asks an RPC endpoint for a base fee estimate, builds the transaction object, hashes it, signs the hash, and produces the final signed bytes. Up to this moment, nothing has touched the network. You can cancel for free.
Stage two is broadcast. Your wallet posts the signed transaction to a node, usually through an Infura, Alchemy, or QuickNode RPC. The node checks the signature, the nonce, and that you have enough ETH to cover the maximum possible fee, then gossips the transaction to its peers. Within a couple of seconds, every node on the network has seen it.
Stage three is the mempool. Your transaction sits in a pool of pending transactions, ordered by the priority tip you offered. Validators look at this pool when it is their turn to propose a block. If your tip is competitive for the current congestion, you are picked into the next block. If the network is congested and your tip is too low, you wait until the next time conditions change.
Stage four is inclusion. A validator picks your transaction (along with whatever else fits within the 30 million gas block limit) and adds it to a candidate block. The block is gossiped to the network and your transaction now has one confirmation.
Stage five is execution. Every node on the network independently runs your transaction in their copy of the Ethereum Virtual Machine. They update account balances, contract storage, and emit logs. The EVM keeps a running tally of gas consumed; if it exceeds your gas limit, the entire transaction reverts (state changes are rolled back) but the validator still keeps the gas already spent.
Stage six is finality. Two epochs later (about 13 minutes on mainnet) enough validators have voted that the block is considered economically final. Reverting it from this point would require attackers to burn billions of dollars in slashed stake. The transaction is now permanent on the canonical chain.
Section 04 · Gas
What gas actually pays for
Gas is the unit of work on Ethereum. Every operation has a fixed cost and the total fee you pay is the sum of those costs times the price you offered.
The EVM is a stack machine. Every instruction it runs (an addition, a storage write, a call to another contract) has a published gas cost. A plain ETH transfer costs 21,000 gas, fixed. A simple token transfer costs around 50,000 gas because it has to update two storage slots. A swap on a DEX costs 100,000 to 200,000 gas because it touches several contracts and emits events. A complex DeFi transaction can cost 500,000 gas or more.
The fee in ETH is straightforward to compute. Take the gas your transaction actually consumed, multiply by the gas price you paid (base fee plus your priority tip, capped at maxFeePerGas). That product, in wei, is your fee. Wallets show it in gwei because wei numbers are unreadable. One gwei is a billionth of an ETH.
The base fee burns. The tip pays the validator.
Since EIP 1559 in 2021, the base fee for every block is calculated by the protocol itself based on demand from the previous block. The ETH paid as base fee is destroyed, removed from circulation forever. Only the priority tip goes to the validator who included the transaction. This is why wallets show two numbers: the base fee they expect the network to demand, and the tip you are willing to pay on top to be picked sooner.
Why does the network burn fees? Two reasons. First, it makes the fee dynamic without enriching validators when usage spikes (which would otherwise create perverse incentives for validators to congest the network). Second, it gives ETH a deflationary pressure during high usage periods, which has been a major part of Ethereum's monetary narrative since the merge.
Practical advice. For a non urgent transfer, set your priority tip at one gwei or less and you will usually be picked within a few blocks. For a time sensitive trade or NFT mint, you may need 10 to 50 gwei or more during peak congestion. Wallets that show "fast", "average", "slow" estimates are doing the same math against the current pending mempool.
Section 05 · Contract Calls
When the to field is a contract
The same transaction format that moves ETH between wallets also calls smart contracts. The difference is what goes in the data field.
When you call a contract function, your wallet builds the data field as the function selector plus the ABI encoded arguments. The function selector is the first four bytes of the keccak256 hash of the function signature. So calling transfer(address,uint256) on USDC means your data field starts with the bytes 0xa9059cbb followed by the recipient address and the amount, both padded to 32 bytes.
The EVM looks up the matching function in the contract's bytecode, runs it, and updates the contract's storage. The transaction's value field can still be non zero (some functions are payable and accept ETH alongside the call) but for a token transfer it is usually zero, because the asset being moved lives inside the contract's storage map of balances.
One detail that surprises people. The contract has no idea who you are except through the signed sender. Inside Solidity this is msg.sender, and it is exactly the address recovered from your signature. Contracts use it to authorize actions: only the owner can pause, only the approved spender can move tokens. The signature is the entire authentication system.
Section 06 · When Transactions Fail
The four ways a transaction can go wrong
Not every confirmed transaction succeeded. Reading why one failed is half the work of debugging on chain.
Out of gas
Your gas limit was lower than what the EVM actually needed. The transaction ran until the meter hit zero, then reverted. The validator keeps the gas anyway. Wallets generally pad estimates, but a contract that is more expensive than expected (because of branchy logic or storage warming) can still trip this. Fix: estimate again with a fresh state, raise the limit by 20 percent.
Revert from contract logic
The contract you called explicitly checked a condition and reverted with an error message: insufficient allowance, slippage too high, deadline passed, paused. The receipt's status field is 0 and the trace shows the revert reason. The fix is application specific. The fee you paid is not refundable.
Stuck nonce
An earlier transaction from the same address is still pending and yours has a higher nonce, so the network refuses to process it until the earlier one is mined or replaced. To fix it, send a replacement transaction with the same nonce as the stuck one and a higher priority fee. The replacement evicts the original from the mempool.
Front running and MEV
A bot saw your transaction in the public mempool and submitted a better paying one that ran first, which changed state in a way that made yours unprofitable or invalid. Common with large swaps. Mitigations include private mempools (Flashbots Protect, MEV Blocker), on chain order routers that include slippage protection, and limit orders that only execute at acceptable prices.
The right place to investigate any failure is the receipt on Etherscan, plus the trace if it is a contract call. Trace tools like Tenderly let you replay the transaction step by step, see which line reverted, and inspect storage at every step. For anything more than the simplest debugging, the trace is what tells you what really happened.
Section 07 · FAQ
Frequently asked questions
Why did my transaction cost gas even though it failed?
Validators executed the transaction up to the point where it reverted, which used real computation. The protocol pays validators for that work regardless of outcome, otherwise nodes could be forced to execute infinitely many guaranteed to fail transactions for free. The fee for the work already done is kept; only unused gas is refunded.
Can I cancel a pending transaction?
Yes, by replacing it. Send a new transaction from the same address with the same nonce as the stuck one and a higher priority tip. Most wallets call this Speed Up or Cancel. The cancel version is usually a zero ETH transfer to your own address. The replacement evicts the original from the mempool. There is no way to revoke a transaction that is already mined.
What is the difference between gas, gas price, and gas fee?
Gas is the unit measuring how much work the transaction does. Gas price is how much ETH (in gwei) you offered to pay per unit of gas, made up of the protocol base fee plus your priority tip. Gas fee is the total ETH spent: gas used times the effective gas price. People often blur the three together but they are distinct.
Why does the same kind of transaction cost different amounts at different times?
The number of gas units is roughly fixed for a given operation. The gas price is not. It is set by an open auction across the mempool: when many people are competing for block space, the base fee rises and validators only pick transactions with high tips. During quiet hours the fee can be a fraction of a dollar; during a hot NFT mint it can be hundreds of dollars for the same operation.
How many confirmations should I wait for before considering a transaction final?
For most application uses one or two confirmations is enough; the chance of a reorg at one block is low and at two blocks is negligible. For high value transfers (over six figures) or cross chain bridge withdrawals, wait for two epochs of finality, about 13 minutes. Exchanges typically wait 12 to 64 confirmations before crediting deposits, depending on amount.
Is it cheaper to send ETH or to send a token?
ETH is cheaper. A plain ETH transfer is exactly 21,000 gas. A standard ERC20 token transfer is around 50,000 gas because the token contract has to update at least two storage slots. The exact cost depends on whether the recipient already had a balance (warming a fresh storage slot is more expensive than overwriting an existing one).