Skip to content
DonateБГ

Beginners

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.

One input is spent into a payment, a change output and a fee. 0.5 BTC Input a coin you received 0.50000000 BTC Transaction payment change 0.20000000 BTC 0.29999000 BTC Fee: 0.00001000 BTC (1,000 sats) Inputs minus outputs equals the fee.
Example amounts. The input is spent whole, and the change returns as a new output.

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 transaction is signed, sent to nodes, waits in the mempool, enters a block, and is confirmed. Signed by you Sent to nodes Waits in mempool In a block by a miner Confirmed +1 per block
The steps run in this order, from your wallet to a confirmed block.

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.

Only a valid signature from the matching key unlocks an output, and nodes reject anything without one. signature 0.2 BTC Valid Nodes accept it and pass it on. Invalid Nodes reject it. Nothing moves. The lock stays on the coin until it is spent.
The signature proves you hold the key, without showing the key itself.

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.

Next, read outputs. It explains how each output holds its coins until someone spends them.

In this section: Beginners

All of Bitcoin from zero

Something look wrong? Tell us