The short answer
Four parts do all the work, and each one has exactly one job.
- A wallet holds a key and signs.
- Nodes check that a signature and a transaction obey the rules.
- Miners decide the order transactions go in, and pay for that right with electricity.
- The blockchain is the record they all end up agreeing on.
Nobody is in charge of the four together. Each part is doing something narrow and selfish, and the useful behaviour falls out of the combination. The rest of this post is that sentence, slowly.
If you have not read what Bitcoin actually is, start there; this post assumes you know what a bitcoin is and what the 21 million cap means.
Wallets: the part that signs
A wallet does not hold your bitcoin. Your bitcoin are entries in a public ledger. What the wallet holds is the private key that can authorise moving them.
Three terms, and people mix them up constantly:
- The private key is a secret number. It is not a password. There is no server that checks it and no reset link if it is gone. It exists only on your device.
- The public key is derived from the private key by a one-way calculation. It can be published safely.
- An address is derived in turn from the public key. It is what you give somebody who wants to pay you.
The derivation runs one way only: address from public key, public key from private key, and never backwards. Signing a transaction proves you hold the private key without ever revealing it, which is the whole trick. There is more on choosing one in how to choose a wallet.
Where the analogy people reach for breaks down: an address is nothing like an email address, because an email address is registered with a provider who can take it away. Nobody issued your address and nobody can revoke it. It was calculated.
Nodes: the part that checks
A node is a computer running Bitcoin software that keeps its own copy of the ledger and checks everything against the rules itself. Is the signature valid? Are those coins unspent? Is the block within the size limit? Does its subsidy match the schedule?
A node that sees something invalid drops it and passes nothing on. It does not report the sender, and it cannot force any other node to agree. It simply refuses to relay, and refuses to count it. Multiply that by every node on the network and an invalid transaction gets nowhere.
Nodes earn nothing. They are not paid, and they do not compete. That surprises people, and it is precisely why they can be trusted to enforce rules that cost miners money. More in Bitcoin nodes.
Miners: the part that orders
Everything above tells you whether a transaction is valid. None of it tells you which of two conflicting transactions came first, and that is the problem that had defeated every previous attempt at digital cash. If I sign two transactions spending the same coin to two different people, both are individually valid. Somebody has to decide which one counts.
Mining is the answer. Miners gather valid transactions from the waiting area (the mempool), assemble them into a candidate block, and then race to find a number that makes the block's fingerprint fall below a target. The only way to find it is to try enormous numbers of guesses. Whoever lands one first publishes the block, collects the subsidy and the fees, and their ordering is the one everybody builds on.
The cost is the point. Rewriting recent history means redoing that work faster than the rest of the network is doing it live. See Bitcoin miners for how the economics of that hold up.
The blockchain: the part that records
Each block carries the fingerprint of the block before it. Change anything in an old block and its fingerprint changes, which breaks the link the next block recorded, and the next, all the way to the tip. That is what makes the record append-only in practice rather than by policy. The blockchain takes that mechanism apart in detail.
What happens when you send bitcoin
- You enter an address and an amount, and choose a fee rate: what you are willing to pay per unit of transaction size for a miner to include it.
- Your wallet builds the transaction and signs it with your private key. Nothing has left your device yet, and nothing has been asked of anyone.
- The signed transaction goes to the nodes your wallet is connected to. Each one validates it independently and relays it to its own peers. Within seconds it is sitting in mempools across the network.
- A miner includes it in the block they are working on, and eventually some miner finds a valid block. Your transaction now has one confirmation.
- Every node checks that block for itself, and appends it. Each subsequent block on top is another confirmation, and makes reversing it exponentially more expensive.
Blocks arrive on average every ten minutes, and the difficulty of the search is adjusted every 2,016 blocks (roughly two weeks) to keep that average steady. Average is doing real work in that sentence: the search has no memory, so some blocks arrive a minute apart and some take an hour. A transaction that pays too little for current demand can wait a lot longer than that, or never confirm at all, in which case the coins were never moved.
What people get wrong
"Miners approve transactions." They do not. Miners choose which valid transactions to include and in what order. Whether a transaction is valid is decided by every node, including yours, and a miner who includes an invalid one has burned the electricity for a block everybody discards.
"The blockchain is stored in one place." There is no canonical copy. There is a copy on every node, and consensus is what happens when independently run software applies identical rules to the same data and gets identical answers.
"Confirmed means it can never be undone." It means undoing it costs more the longer you wait. One confirmation is worth much less than six, and the difference matters if you are handing over something irreversible in exchange.
Where to go next
The natural next step is the blockchain, which explains why changing an old record breaks every record after it. After that, miners and nodes make more sense read in that order.
