# Transaction lifecycle: send, mempool, confirm

> What happens between sending an EVM transaction and knowing whether it worked: the hash, the pending pool, the block and the receipt.

Source: https://hashspan.dev/learn/tx-lifecycle

By Selim Aytaç, maintainer · Published Oct 1, 2026 · Updated Oct 18, 2026

## Short answer

When you send an EVM transaction, the node returns its hash right away, before anything has run. The transaction then waits with other pending transactions until a block producer includes it in a block. Only the receipt from that block tells you whether it succeeded or reverted, and what it cost.

Figure: The five steps of an EVM transaction from send to final, where hashspan's send and confirm spans begin and end, and the three ways it can go wrong after send.

## What are the steps?

1. **Send.** The client signs the transaction and sends it to a node. The node returns the hash. Nothing has executed yet.
2. **Pending.** The transaction joins a pool of pending transactions and waits ([ethereum.org](https://ethereum.org/en/developers/docs/transactions/)).
3. **Included.** A block producer puts it in a block. Now it runs and changes state, or reverts.
4. **Receipt.** The block's receipt records the outcome: status, gas used, effective gas price, logs.
5. **Final.** Over time the block becomes harder and harder to undo.

The gap between step 1 and step 4 is where most surprises live.

## What can go wrong after send?

- **It reverts.** It's included and pays for its gas, but nothing it tried to change sticks.
- **It's replaced.** Another transaction from the same sender with the same nonce is mined instead, for example a speed-up or a cancel. viem reports this as `replaced`, `repriced` or `cancelled` ([viem docs](https://viem.sh/docs/actions/public/waitForTransactionReceipt)), and Etherscan shows the first one as [dropped and replaced](https://hashspan.dev/errors/transaction-dropped-and-replaced).
- **It never lands.** It sits in the pool until whoever is waiting gives up. See [transaction stuck pending](https://hashspan.dev/errors/transaction-stuck-pending) for the usual causes.

## Why does this matter for agents?

An agent's tool usually returns at step 1, with a hash. The trace marks the tool call as fine and moves on. Steps 2 to 4 happen outside the trace. [This post](https://hashspan.dev/blog/agent-trace-stops-at-the-tool-call) walks through a real example where the tool call looks fine and the transaction reverted.

Trace (pay_vendor · from make demo, durations from the run; positions approximate):

- `execute_tool pay_vendor`: 26.3 ms
  - `send 31337`: 13.4 ms
  - `confirm 31337`: 11.8 ms

Send ends when the hash comes back. Confirm ends when the receipt does.

**In a hashspan trace:**
hashspan maps the lifecycle onto two spans:

  - `send {chainId}` ends at step 1, when the hash comes back or sending fails.
  - `confirm {chainId}` ends at step 4, when the receipt arrives, or on timeout.

`blockchain.tx.status` on the confirm span is `success`, `reverted` or `replaced`. If the wait gives up, the span ends with error status and `error.type` `timeout`. A replaced span also carries `blockchain.tx.replacement.hash`, the hash that was mined instead.

With viem, [viem OpenTelemetry instrumentation](https://hashspan.dev/docs/viem-opentelemetry) shows both spans from a real run, including a reverted `writeContract`.

## FAQ

### Does getting a transaction hash mean it succeeded?

No. The hash only means the node accepted the transaction. It can still revert, be replaced by another transaction with the same nonce, or never be included.

### Does a reverted transaction cost anything?

Yes. It's included in a block and pays for the gas it used, but its state changes are rolled back.

### How many confirmations should I wait for?

viem's waitForTransactionReceipt waits for one by default and accepts a confirmations option. More blocks make a reorg less likely to undo it.
