Transactions
A bitcoin transaction spends earlier outputs and creates new ones. Learn inputs, outputs, fees and locks, with a real example on our explorer.
By Dimitar Zurnov · Updated 4 Nov 2026
Adapted from Learn Me a Bitcoin by Greg Walker.
A bitcoin transaction moves coins from one owner to another. It spends coins that someone paid you earlier, and it creates new coins for the people you pay. Your wallet sends the transaction to nodes. The nodes check it and pass it on. A miner then puts it in a block, and once confirmed, it stays in the record.
What is a transaction?
A transaction is data. It has three parts: inputs, outputs and a fee. An input is a reference to an earlier output that the transaction spends. An output is an amount of bitcoin, with a lock that says who may spend it later.
The fee is not a separate field. It is whatever the inputs have left over after the outputs. The miner who includes the transaction keeps that amount.
Sending a transaction means sending that data to the network.
How do coins move?
Bitcoin does not store one balance per person. Each payment you receive is a separate output, locked to your address. Think of coins like banknotes. If a purchase costs less than the note you hold, you cannot tear the note. You hand over the whole note and get change back.
Bitcoin works the same way. A transaction spends whole outputs. It creates a new output for the person you pay, and another for your change. Whatever the inputs leave over goes to the miner as the fee.
One bitcoin is 100,000,000 satoshis, or sats. Change can be any exact number of sats, so the amounts always add up.
How does a transaction reach a block?
Your wallet signs the transaction with your keys and sends it to one or more nodes. Each node checks it and keeps it in its mempool until a miner picks it. When a miner adds the transaction to a block, it is confirmed. Each block added on top adds one more confirmation.
A higher fee makes it more likely that a miner picks the transaction early. A low fee can mean a long wait.
Why can't someone else spend my coins?
Each output is locked. Only someone with the matching private key can unlock it, by making a signature. Nodes check that signature before they accept a transaction. Without a valid one, the transaction is rejected, and the coins stay where they are.
The signature page explains how a signature proves ownership without revealing the key.
What does a transaction look like on Explore21?
Each transaction has its own page on our explorer, at /tx/ followed by its ID. The ID is a 64-character code, the hash of the transaction data.
The first payment between two people is a good example. It sits in block 170, and its ID is f4184fc5…9e16. It spends one output of 50 BTC. It sends 10 BTC to Hal Finney and returns 40 BTC to the sender as change. The fee is zero, because the inputs and outputs match exactly.
Another well-known example is a purchase from May 2010. A transaction in block 57,043 moved 10,000 BTC to pay for two pizzas. Its ID is a1075db5…d48d.
What should you read next?
Next, read outputs. It explains how each output holds its coins until someone spends them.
In this section: Beginners
Something look wrong? Tell us