Not Accounts—UTXOs
Bitcoin doesn't use accounts with balances like a bank. Instead, it uses UTXOs—Unspent Transaction Outputs. Think of them like discrete "coins" of various sizes.
When you receive bitcoin, you receive one or more UTXOs. When you spend, you consume entire UTXOs and create new ones. Your "balance" is just the sum of all UTXOs you control.
Transaction Structure
Every Bitcoin transaction has inputs (UTXOs being spent) and outputs (new UTXOs being created):
INPUTS (being spent)
OUTPUTS (created)
Notice: Inputs (0.80) = Outputs (0.79) + Fee (0.01). The fee is implicit—it's whatever is left over. Forget to add a change output, and the miner takes everything!
Locking and Unlocking
Each UTXO is "locked" with a script that specifies conditions for spending. The most common: "provide a signature from this public key."
When you spend a UTXO, you provide an "unlocking script" (usually your signature). If it satisfies the locking conditions, the UTXO can be spent.
Script Example: Pay-to-Public-Key-Hash (P2PKH)
The most common transaction type. Lock: "Only someone with the private key for this address can spend."
OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG
// Unlocking script (provided by spender):
<signature> <pubKey>
Translation: "Duplicate the public key, hash it, check it matches the expected hash, then verify the signature is valid for this key."
Transaction Fees
There's no "fee" field in a transaction. The fee is simply inputs minus outputs. Whatever's left over goes to the miner who includes your transaction.
| Factor | Effect on Fee |
|---|---|
| Transaction size | Larger tx = more bytes = higher fee needed |
| Network congestion | More pending txs = higher fee to get confirmed fast |
| Number of inputs | More inputs = larger tx = higher fee |
| Urgency | Need fast confirmation? Pay more |
Fees are measured in satoshis per virtual byte (sat/vB). During high demand, fees can spike. During quiet periods, you can get confirmed for just a few sats/vB.
Transaction Types
| Type | Use Case | Size |
|---|---|---|
| P2PKH | Legacy addresses (1...) | Larger |
| P2SH | Script hash, multisig (3...) | Medium |
| P2WPKH | Native SegWit (bc1q...) | Smaller |
| P2TR | Taproot (bc1p...) | Most efficient |
Newer address types (SegWit, Taproot) are more efficient, meaning lower fees for the same transaction.
The Mempool
When you broadcast a transaction, it enters the mempool—a waiting room of unconfirmed transactions. Miners pick from this pool, prioritizing higher-fee transactions.
Frequently Asked Questions
What's a UTXO?
Unspent Transaction Output—the "coins" in Bitcoin. Unlike bank accounts (subtract from balance), Bitcoin tracks individual unspent chunks. Your wallet manages many UTXOs automatically.
Why do I pay fees?
You're bidding for block space. Each block fits ~3,000 transactions. When demand is high, fees spike. The fee also protects against dust spam—tiny UTXOs would cost more to spend than they're worth.
Can I spend someone else's Bitcoin?
Only if you have their private key. Signatures are math—you cannot fake them. Without the key, the math doesn't work and every node rejects the transaction.