Transactions Deep Dive
The UTXO model, transaction structure, fees, and signature verification — the complete mechanics of Bitcoin transfers.
3 min read
Key points
Bitcoin has no account-balance concept — instead, holdings are tracked as a collection of Unspent Transaction Outputs (UTXOs). This article walks through transaction structure, the validation process, fee mechanics like RBF and CPFP, how confirmations work, and the impact of SegWit.
The UTXO Model: No Account Balances
- Bitcoin has no concept of "account balance." Instead, it uses the UTXO (Unspent Transaction Output) model.
- Your "balance" is the sum of all unspent outputs associated with your addresses. It's like having three ¥100 coins and one ¥500 coin — not an abstract "¥800 balance" but a specific collection of "coins."
- When sending, you consume one or more UTXOs as "inputs" and create new "outputs" (payment to recipient + change back to yourself). Consumed UTXOs become spent and can never be used again.
- Advantages: easy double-spend detection, parallelizable processing, and better privacy management (coin control). A fundamentally different paradigm from the bank account model.
Transaction Structure
- Version number (4 bytes): Currently 2 is most common; version 2 is required for OP_CHECKSEQUENCEVERIFY.
- Inputs (TxIn): References to previous transaction outputs. Composed of "previous transaction hash" (32 bytes), "output index" (4 bytes), "scriptSig" (unlocking script with signature and public key), and "sequence number" (4 bytes).
- Outputs (TxOut): Specify destination and amount. Composed of "value" (8 bytes, in satoshis) and "scriptPubKey" (locking script).
- Locktime (4 bytes): Optionally sets a block height or timestamp before which the transaction cannot be valid.
- In SegWit transactions, signature data (witness) is separated from the transaction body, effectively increasing block capacity and solving the transaction malleability problem.
Transaction Validation Process
- Validation occurs in two stages: ① Execute the input's scriptSig → ② Execute the referenced output's scriptPubKey using scriptSig results. If the stack's top value is true (non-zero), the transaction is valid.
- Standard P2PKH validation flow: Signature and public key from scriptSig → public key is hashed and compared to the hash in scriptPubKey → signature validity is verified → all checks pass, transaction approved.
- Miners select unconfirmed transactions from the mempool, prioritizing those with higher fees for block inclusion.
- Critical: The difference between total input value and total output value becomes the transaction fee. Any value not included in outputs is permanently lost — always create a change output.
How Fees Work
- Bitcoin fees are based on transaction data size (bytes), not the amount sent. Sending 1 BTC costs the same as 0.001 BTC if the transaction size is identical.
- Fee rates are expressed as "sat/vB" (satoshis per virtual byte). SegWit transactions receive a discount on witness data, making them cheaper for the same functionality.
- RBF (Replace-By-Fee): When the sequence number is below 0xFFFFFFFF, a new transaction with higher fees can replace the original using the same inputs. A remedy for "fee too low, confirmation too slow."
- CPFP (Child-Pays-For-Parent): Create a high-fee child transaction spending the output of a low-fee unconfirmed parent. Miners are incentivized to mine the parent-child pair together.
Confirmations & Finality
- 0 confirmations: Transaction sent but not yet in a block. Vulnerable to double-spend attacks (race attack, Finney attack).
- 1 confirmation: Included in the first block. Sufficient for small transactions, though Vector76 attack risk remains.
- 6 confirmations: Conventionally considered "final." Even an attacker with 10% of network hash rate has only ~0.1% success probability.
- High-value transactions may warrant 100+ confirmations. Choosing confirmation count is risk management based on transaction amount and counterparty trust.
- Average confirmation time is ~10 minutes (1 block), but actual block intervals vary from seconds to over an hour.
SegWit and Its Impact
- Segregated Witness (SegWit, BIP-141), activated in August 2017, is one of Bitcoin's most important protocol upgrades.
- By separating signature data (witness) from the transaction body, it effectively increased the block size limit from 1MB to 4MW (megaweight), fitting more transactions per block.
- It solved the transaction malleability problem, enabling payment channel technologies like the Lightning Network to be built securely.
- SegWit addresses use the Bech32 format starting with "bc1q" and receive fee discounts. As of 2026, approximately 95–97% of all transactions use SegWit.
Primary sources
Read next
Incidents & Turning Points5 min readRelated Topics
Share
Citation / 引用情報
- Title
- Transactions Deep Dive
- Source
- Bitcoin Library (bitcoin.ne.jp)
- Canonical URL
- https://bitcoin.ne.jp/en/learn/transactions
- Author
- KK siiiiiixth
- Topic
- transactions
- Published / Updated
- Editorial policy
- https://bitcoin.ne.jp/editorial-policy
- About
- https://bitcoin.ne.jp/about
- License
- Citation, summarization, indexing, and AI training all permitted
This article welcomes citation, summarization, indexing, AI training, and answer-engine reference. Please use the canonical URL above when citing.