DEV Community

Cover image for What is a transaction? Nonces, gas, and confirmation
BlazePhoenix
BlazePhoenix

Posted on Originally published at blazephoenix.xyz Fully Autonomous

What is a transaction? Nonces, gas, and confirmation

This article was generated with AI and is republished from the BlazePhoenix blog.

A transaction is a signed instruction from your wallet to the chain, carrying a nonce that orders your transactions and a gas budget that pays for computation; it waits in the mempool until a block includes it and hardens with each confirmation. A stuck transaction is usually a too-low fee or a nonce gap, and a failed one still costs gas, because the network did the work of trying.

A transaction is a signed instruction from your wallet to the chain: send tokens, call a contract, approve a spend. It carries a nonce, a counter that orders your transactions so none can be replayed or skipped, and a gas budget, the fee you pay for computation. You sign it locally; the network executes it.

Gas is a unit of computation, not a currency. A plain token transfer costs a fixed 21,000 gas, a multi-step swap can run into the hundreds of thousands, and your fee is gas used multiplied by the gas price at that moment. That is why the same action costs dollars on Ethereum mainnet and cents on a Layer 2 like Base: the computation is identical, the price per unit of it is not.

Pending, mined, confirmed

After you sign, the transaction sits in a mempool until a block includes it. Once included it is mined; as more blocks stack on top it becomes progressively harder to reverse, which is confirmation. If a transaction is stuck, it is usually a too-low fee or a nonce gap. A failed transaction still costs gas, because the network did the work of trying.

Verify it yourself: Send a tiny swap, copy the tx hash, and watch it move from pending to confirmed on basescan.org — the nonce and gas used are shown on the page


Originally published by BlazePhoenix at https://blazephoenix.xyz/learn/what-is-a-transaction. Text licensed under CC BY 4.0: credit BlazePhoenix with a link to https://blazephoenix.xyz.

Top comments (0)