How Bitcoin Transactions Work
Bitcoin might seem complicated at first, but once you understand a few key ideas, the process becomes much clearer. This page covers both the structure of transactions and what happens when you send one.
Inputs and Outputsβ
Bitcoin doesn't work like a bank account where your balance is just a number. Instead, it uses the UTXO model (Unspent Transaction Outputs).
For a complete explanation of UTXOs, see UTXOs Explained.
- Input: Where the Bitcoin is coming from (previous UTXOs you own)
- Output: Where the Bitcoin is going (new UTXOs being created)
When you send Bitcoin, you're telling the network:
"I want to consume these inputs (UTXOs I previously received) and create these outputs (new UTXOs for the recipient and change for myself)."
You Always Spend the Whole Inputβ
One important detail: Bitcoin doesn't let you spend just a portion of an input. You always spend the whole thing. If you only need part of it, the rest is sent back to you as change, usually to a new address that your wallet controls automatically.
Example:
- You have an input worth 0.01 BTC
- You send 0.008 BTC to a friend
- The remaining 0.002 BTC goes back to you as change on a new address
Your wallet takes care of this behind the scenes, but it helps to understand what's happening.
Transaction Feesβ
To get your transaction included in a block, you pay a small fee to the miners. This fee isn't a separate line itemβit's simply the difference between the amount you're spending and what's being sent out.
Going back to our example:
- Inputs: 0.01 BTC
- Outputs: 0.008 BTC to friend + 0.0019 BTC change
- Fee: 0.0001 BTC (automatically calculated by your wallet)
That means the remaining 0.0001 BTC was used as the transaction fee.
Your wallet usually calculates the fee for you, based on how busy the network is.
Fees depend on transaction size (in bytes), not the value being sent. More UTXOs means a larger transaction and higher fees. See Transaction Fees for a complete guide.
Transaction Lifecycleβ
When you send Bitcoin, the transaction goes through a series of steps before it's fully confirmed and secure. Here's what happens behind the scenes.
Step 1: Creating the Transactionβ
It all begins in your Bitcoin wallet. You enter the recipient's address and the amount you want to send. The wallet then:
- Selects which coins (UTXOs) to use
- Generates the outputs, including any change back to you
- Calculates an appropriate fee based on current network conditions
Once everything is set, the transaction is signed using your private key. This signature proves that you're authorized to spend the funds and makes the transaction ready for broadcasting.
Step 2: Broadcastingβ
Next, your wallet sends the signed transaction to the Bitcoin network. It connects to one or more Bitcoin nodes and transmits the transaction data. The nodes validate that your transaction follows the rules and then relay it to other nodes.
Within seconds, your transaction is visible across the network.
Step 3: The Mempool (Waiting Room)β
Every full node on the Bitcoin network keeps a copy of the mempoolβa holding area for unconfirmed transactions. This is where your transaction waits to be included in a block.
Miners review the mempool and select which transactions to include, typically favoring those that pay higher fees per byte (sat/vB).
If your fee is too low, your transaction might stay in the mempool for a while. You can speed things up using:
- RBF (Replace-By-Fee): Rebroadcast with a higher fee
- CPFP (Child-Pays-For-Parent): Spend the unconfirmed output with a high-fee transaction
Step 4: Block Inclusionβ
Roughly every 10 minutes, a miner successfully mines a new block and includes a set of transactions from the mempool. If your transaction makes it into the block, it's now considered confirmedβthis is the moment it officially becomes part of the blockchain.
Step 5: Confirmationsβ
Once your transaction is in a block, each additional block that gets added afterward increases its number of confirmations:
| Confirmations | Status | Typical Use |
|---|---|---|
| 0 | Unconfirmed | Transaction broadcast but not yet in a block |
| 1 | Confirmed | In a block; suitable for small payments |
| 3 | More secure | Reasonable for medium amounts |
| 6 | Highly secure | Standard for large transactions |
The more confirmations a transaction has, the harder it becomes to reverse. That's why businesses and users often wait for multiple confirmations before considering a payment final.
TRANSACTION FLOW
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Create β Sign β Broadcast β Mempool β Block β Confirmed
β β β β β β
Wallet Private Nodes Waiting Miner Each new
builds key relay for adds block adds
tx proves to miner to confirmation
owner network pickup blockchain
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Key Takeawaysβ
- Transactions consume inputs (UTXOs you own) and create outputs (new UTXOs)
- You always spend the whole inputβexcess comes back as change
- Fees are the difference between inputs and outputs
- Transactions wait in the mempool until a miner includes them in a block
- More confirmations = more security (6 is the standard for large amounts)