Life of a Bitcoin Transaction
From the moment you press “Send” to the final confirmation on the blockchain, every step visualized
01Key Generation
Everything starts with randomness. Your wallet generates a private key, a random 256-bit number, then derives a public key using elliptic curve multiplication (secp256k1). The Bitcoin address is a hash of that public key.
Private key = secret (never shared)
Public key = derived via ECDSA on secp256k1
Address = RIPEMD160(SHA256(pubkey)) + Base58/Bech32
02Building the Transaction
Bitcoin doesn't track “balances.” Instead, it uses UTXOs (unspent transaction outputs). To send BTC, your wallet selects UTXOs that total at least the amount you want to send, and constructs a new transaction.
Reference to previous tx output (txid:vout)
Unlocking script (scriptSig / witness)
Outputs (where coins go):
Output 0: 0.05 BTC to recipient address
Output 1: 0.0489 BTC to your change address
Implicit fee = inputs minus outputs = 0.0011 BTC
03Digital Signature
Your wallet signs each input with the corresponding private key using ECDSA (or Schnorr for Taproot). This proves you own the coins being spent without revealing your private key.
Anyone can verify using the public key:
ECDSA_Verify(pubkey, txhash, sig) → pass or fail
The signature is placed in the scriptSig (legacy) or witness (SegWit) field of each input.
04Broadcast to the Network
Your wallet sends the signed transaction to a connected Bitcoin node. That node validates it and relays it to its peers. Within seconds, the transaction floods across thousands of nodes worldwide via gossip protocol.
Inputs reference existing, unspent UTXOs
Signatures are valid for each input
Input value is greater than or equal to output value (positive fee)
Not a double spend of already seen tx
Scripts evaluate to TRUE
Transaction size within limits
05The Mempool
Each node keeps a “waiting room” of unconfirmed transactions called the mempool (memory pool). Your transaction sits here, competing with thousands of others. Miners pick from this pool to build the next block.
Higher fee rate means picked sooner
If mempool is full, lowest fee txs get evicted
06Mining & Proof of Work
A miner selects transactions from the mempool (prioritizing high fee rates), assembles them into a candidate block, and begins the Proof of Work grind: repeatedly hashing the block header with different nonces until the hash falls below the difficulty target.
timestamp | difficulty_bits | nonce
The mining loop:
If no, try another nonce (trillions of attempts)
If yes, block found! Broadcast immediately.
07Merkle Tree Construction
Before mining, the miner hashes all selected transactions into a Merkle tree. The root of this tree (the Merkle Root) goes into the block header. This commits to every transaction in the block with a single 32-byte hash.
08Block Propagation
The winning miner broadcasts the new block to the network. Each node independently validates the block, checking the PoW, all transaction signatures, UTXO references, the Merkle root, and the link to the previous block. Valid blocks are appended to the chain.
Previous block hash matches chain tip
Merkle root matches transaction list
Every transaction passes full validation
Block size within consensus limits
Coinbase reward is at most subsidy + total fees
Timestamp within acceptable range
09Confirmations
Once your transaction is in a block, it has 1 confirmation. Each subsequent block mined on top adds another confirmation. The deeper it's buried, the harder it is to reverse because an attacker would need to redo the Proof of Work for every block on top.
3 confirmations is safe for moderate amounts
6 confirmations is the Bitcoin gold standard (~1 hour)
Reversing 6 blocks requires an attacker to outpace the entire honest network's hash power for ~1 hour, which is astronomically expensive.
10UTXO Set Updated
Every full node updates its UTXO set: the inputs your transaction spent are removed (now spent), and the new outputs are added (now available for future spending). The cycle is complete and your recipient can now spend their new UTXO.
The recipient's wallet sees the new UTXO and updates their displayed balance.
The transaction is now final.