Every Bitcoin transaction passes through the same eight stages. Here's the roadmap:
The wallet selects UTXOs (unspent transaction outputs) that belong to the user, constructs outputs specifying the recipient and amount, computes the fee, and signs each input with the corresponding private key. The result is a serialized transaction β a blob of bytes ready for the network.
Key detail: The signature covers nearly the entire transaction (SIGHASH_ALL by default), making it tamper-proof. If anyone changes an output amount or destination, the signature becomes invalid.
Source: Bitcoin Developer Guide β TransactionsWhat does the wallet sign before broadcasting the transaction?
The wallet sends the serialized transaction to one or more connected
full nodes via a tx message (or, if using the
inv/getdata flow, the node first announces it
has a new transaction via inv, the peer requests it with
getdata, and the wallet responds with tx). In
practice, wallets often use the simpler tx push: just send
the transaction directly.
Key detail: The wallet doesn't need to be a full node. It only needs a connection to at least one peer that accepts and relays transactions. SPV (simplified payment verification) wallets do exactly this.
Source: Bitcoin Developer Guide β Transaction Broadcasting
Once a full node receives a valid transaction, it relays it to its
peers. The standard flow: Node A sends an inv (inventory)
message to each peer announcing the txid. Peers that don't already have
the transaction respond with getdata. Node A then sends the
full tx message. This gossip protocol ensures every full
node on the network sees every unconfirmed transaction within seconds.
Key detail: Each node independently validates the transaction before relaying it. If a transaction fails validation (e.g., double-spend, invalid signature, non-standard script), the node rejects it and does not relay it. It may also increase the peer's "ban score" for sending invalid data.
Source: Bitcoin Developer Guide β Transaction Broadcasting; Bitcoin Wiki β inv messageAfter validating a transaction, each full node adds it to its mempool (memory pool) β an in-memory set of unconfirmed transactions eligible for inclusion in the next block. The mempool is not shared or synchronised globally; every node has its own. Transactions stay in the mempool until they are either mined into a block, evicted (if a higher-fee transaction pushes them out), or expire.
Key details:
A miner builds a block template β a candidate block β
by selecting transactions from their local mempool. This is done via the
getblocktemplate RPC (or Stratum protocol in pooled
mining). The miner software:
Who builds the template? In solo mining, the miner's
own bitcoind builds it. In pooled mining, the
pool operator builds it and distributes the header (or
parts of it) to participating miners via Stratum. The pool decides which
transactions to include β individual pool miners have no say.
What is the coinbase transaction?
The 80-byte block header is sent to ASIC (Application-Specific Integrated Circuit) miners. The ASIC iterates the nonce field (a 32-bit counter, ~4 billion values) and computes double-SHA256 on the header. If the resulting hash is numerically below the network difficulty target, a valid block is found.
Key details:
When a miner finds a valid block, they broadcast it to their peers. The
propagation path mirrors transaction relay: inv β
getdata β block (or headers β
getdata β block for headers-first nodes, or
direct cmpctblock for compact block relay per BIP 152).
Every full node that receives the block:
Compact block relay (BIP 152): Since peers likely already have most transactions in their mempool, the block can be sent as a header + short transaction IDs. Missing transactions are requested separately. This dramatically reduces bandwidth β from ~1.5 MB to ~15 KB in the common case.
Source: Bitcoin Developer Guide β Block Broadcasting; Optech β Compact Block RelayOnce a block is added to the tip of the chain, the transaction has 1 confirmation. Each subsequent block mined on top adds another confirmation. Most wallets and services consider a transaction "final" after 6 confirmations (a heuristic from Satoshi's whitepaper based on the exponentially decreasing probability of a reorg).
Chain reorganisations (reorgs): If two miners find valid blocks at similar times, the network temporarily has two competing chain tips. Each node follows the one it saw first. When the next block is found, it will build on one of the two tips β the chain with the most accumulated work wins. The other tip becomes a stale block (also called an orphan). Transactions in stale blocks return to the mempool and can be included in future blocks. One-confirmation reorgs happen regularly; deep reorgs (2+ blocks) are rare.
Source: Bitcoin Developer Guide β Orphan BlocksWhat happens to transactions in a stale block after a 1-block reorg?
Alice sends 0.01 BTC to Bob. Here's the journey, end to end:
This is a flyover. Future lessons will zoom into each component in depth: