How a Bitcoin transaction works
Follow one payment from a private key to final settlement — signing, broadcast, the mempool, the mining lottery, and why six confirmations became the rule.
You decide to send Bitcoin
Sending Bitcoin looks like sending an email, and underneath it is nothing like one. There is no account balance anywhere, no bank to phone, and no undo button. Here is what actually happens in the ten minutes after you press send.
Your wallet holds keys, not coins
Your wallet contains no coins. It contains a private key, a number so enormous that guessing one is roughly like picking a single specific atom out of the visible universe. That key is the only thing on Earth that can move your money.
Gather your unspent chunks
Bitcoin does not track balances, it tracks unspent chunks of earlier payments. A wallet showing one and a half coins really means it found several chunks it is allowed to spend, perhaps one of one point one and one of zero point four.
Build the transaction
The transaction itself is a short list. Which chunks are being spent, and where the value should go. Because a chunk has to be spent whole, nearly every transaction also sends the leftover straight back to you as change.
Set the fee
Whatever value you do not assign to anybody becomes the fee. Fees are a live auction for room in the next block, and during a busy week the same simple payment has cost anything from a few cents to more than fifty dollars.
Sign it with your private key
Now you sign. Your private key produces a signature proving you authorised this exact transaction, and anyone in the world can verify it against your public key without ever seeing the private key itself. The key never leaves your wallet.
Broadcast to the network
Your wallet hands the signed transaction to a handful of connected computers, which pass it on to their neighbours. Within a couple of seconds it has reached most of the roughly twenty thousand reachable nodes scattered across the planet.
Every node checks the rules
Every node checks it independently. Are the signatures valid, do the inputs really exist, have they already been spent somewhere else? No node trusts any other node. Anything that breaks a rule is dropped and travels no further.
It waits in the mempool
Valid transactions wait in each node's mempool, a waiting room that is never shared or synchronised between them. Underpay the fee and you can sit here for hours, and after a couple of weeks most nodes simply forget you.
Miners pick the richest fees
Miners assemble a candidate block out of the mempool, and they are not sentimental about it. They take whichever transactions pay the most per byte, fitting perhaps two to three thousand payments into a block of between one and two megabytes.
The hashing lottery
Then comes the lottery. A miner hashes the block header with a counter, over and over, hunting for a result below a target number. Across the whole network this is happening hundreds of quintillions of times every single second.
A block is found
About every ten minutes somebody wins. The difficulty is retuned every two thousand and sixteen blocks to hold that average steady no matter how much hardware joins or leaves, and the winner collects new coins plus all the fees inside.
The block spreads worldwide
The winning block races across the network. Other nodes check it in well under a second, because they already hold most of the transactions inside it, then immediately start working on top of it. Your payment is now written into the chain.
One confirmation
That is one confirmation. Already hard to undo, but not impossible. If two miners win at almost the same instant the chain briefly forks in two, and the shorter branch gets abandoned within a block or two.
Six confirmations
Every block stacked on top makes reversal exponentially more expensive, because an attacker would have to redo all that work faster than the entire rest of the world combined. Six blocks, roughly an hour, became the traditional line for large sums.
Settled, and staying settled
Nothing was deleted and nobody was trusted. A few thousand strangers who have never met agreed on the order of events using arithmetic alone, and your payment is now part of an unbroken record reaching back to two thousand and nine.
Watch it explain itself
Every step above is narrated aloud. Play it, or open it in the editor and make it yours — no account needed.