Diagramium
₿ Narrated diagram

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.

16 steps3 min readNarrated with a studio voice
How a Bitcoin transaction worksvalida winnerabout an hourThe trigger that begins the processYou decide to send BitcoinA step — work that gets doneYour wallet holds keys, not coinsA step — work that gets doneGather your unspent chunksA step — work that gets doneBuild the transactionA step — work that gets doneSet the feeA step — work that gets doneSign it with your private keyA step — work that gets doneBroadcast to the networkA step — work that gets doneEvery node checks the rulesA system or database the process reads/writesIt waits in the mempoolA step — work that gets doneMiners pick the richest feesA step — work that gets doneThe hashing lotteryA step — work that gets doneA block is foundA step — work that gets doneThe block spreads worldwideA step — work that gets doneOne confirmationA step — work that gets doneSix confirmationsA stadium shape that finishes the processSettled, and staying settled
How a Bitcoin transaction works — the complete diagram. Press Present to watch it build itself.
Step 1 of 16

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.

Step 2 of 16

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.

Step 3 of 16

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.

Step 4 of 16

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.

Step 5 of 16

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.

Step 6 of 16

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.

Step 7 of 16

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.

Step 8 of 16

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.

Step 9 of 16

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.

Step 10 of 16

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.

Step 11 of 16

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.

Step 12 of 16

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.

Step 13 of 16

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.

Step 14 of 16

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.

Step 15 of 16

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.

Step 16 of 16

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.