Bitcoin Transactions: The Complete Cheat Sheet

Introduction

Bitcoin transactions are the fundamental units of value transfer on the Bitcoin network. They represent the movement of bitcoin from one address to another, permanently recorded on the blockchain. Understanding how Bitcoin transactions work is essential for anyone using the cryptocurrency, from basic transfers to complex smart contracts. This cheat sheet covers transaction structure, lifecycle, fees, confirmation process, and best practices for creating and managing Bitcoin transactions.

Core Transaction Concepts

Transaction Anatomy

  • Transaction (TX): A record transferring bitcoin value between addresses
  • Inputs: References to previous transaction outputs being spent
  • Outputs: New UTXOs created, specifying recipients and amounts
  • Transaction Fee: Difference between total inputs and total outputs
  • Transaction ID (TXID): Unique identifier hash of the transaction
  • Block: Group of transactions confirmed together (roughly every 10 minutes)
  • Confirmation: Each new block added after a transaction increases confirmations

The UTXO Model

ComponentDescriptionExample
UTXOUnspent Transaction Output; represents spendable bitcoin0.5 BTC received to address X
InputReference to a UTXO being spentSpending the 0.5 BTC from address X
OutputNew UTXO created from transaction0.3 BTC to address Y, 0.19 BTC change back to X
ChangeOutput returning unspent portion to senderThe 0.19 BTC returned to sender (0.01 BTC fee)

Transaction Types

TypeDescriptionUse Case
P2PKHPay to Public Key Hash (legacy)Standard transaction to single address
P2SHPay to Script HashMulti-signature and complex script transactions
P2WPKHPay to Witness Public Key HashSegWit version of P2PKH (lower fees)
P2WSHPay to Witness Script HashSegWit version of P2SH (lower fees)
P2TRPay to TaprootNewest type with enhanced privacy and efficiency
OP_RETURNAllows embedding small amounts of dataTimestamping, proof of existence

Transaction Lifecycle

Creation to Confirmation Step-by-Step

  1. Transaction Creation: Wallet software drafts transaction with inputs, outputs, and fee
  2. Transaction Signing: Private key creates digital signature authorizing the spend
  3. Broadcasting: Signed transaction transmitted to Bitcoin network nodes
  4. Mempool Entry: Transaction awaits in nodes’ memory pools for inclusion in a block
  5. Mining Selection: Miners select transactions based on fee rate (sats/vbyte)
  6. Block Inclusion: Transaction included in a mined block
  7. Block Propagation: New block containing transaction propagated across network
  8. Confirmation Count: Additional blocks mined on top increase confirmation count
  9. Finality: Transaction considered irreversible after 6+ confirmations (~1 hour)

Transaction States

StateDescriptionWhen to Consider “Final”
UnconfirmedBroadcast to network but not in a blockNot final; might never confirm
1 ConfirmationIncluded in one blockAcceptable for small amounts
2-5 ConfirmationsMultiple blocks mined on topSuitable for larger amounts
6+ ConfirmationsSix or more blocks deepIndustry standard for finality
ReplacedSuperseded by another transaction (via RBF)No longer valid
RejectedNot accepted by network (invalid signature, etc.)Never valid

Transaction Fees

Fee Determination Factors

FactorImpactNotes
Transaction Size (vbytes)Larger size = higher total feeSize depends on input/output count and type
Network CongestionHigher demand = higher fee ratesVariable throughout day/week
UrgencyFaster confirmation = higher fee rate neededPrioritize based on time sensitivity
Transaction TypeLegacy > SegWit > Taproot (highest to lowest fee)Newer formats are more efficient
Input/Output CountMore inputs/outputs = larger transactionConsolidate inputs during low-fee periods

Fee Rate Units

UnitDescriptionTypical Ranges (2023)
Satoshis/vbyteFee per virtual byte of transaction1-100+ sat/vB
Satoshis/weight unitFee per weight unit (1/4 of vbyte)0.25-25+ sat/WU
Total FeeComplete fee amount in satoshis500-50,000+ sats
BTC AmountFee expressed in bitcoin0.000005-0.0005+ BTC

Fee Estimation Strategies

StrategyDescriptionBest For
Next BlockHighest fee rate for quick confirmationUrgent transactions
3-6 BlocksMedium fee rate for ~30-60 min confirmationStandard transfers
EconomicLow fee rate for eventual confirmation (hours/days)Non-urgent transactions
Replace-By-Fee (RBF)Start low, increase if neededOptimization during fee volatility
Child-Pays-For-Parent (CPFP)New transaction pays for stuck transactionRescuing stuck transactions

Transaction Technical Details

Transaction Script Types

Script TypeDescriptionCharacteristics
P2PKH ScriptStandard pay to public key hashHigher fee, universal compatibility
P2SH ScriptEnables complex conditions encoded in scriptsVersatile but higher fees than SegWit
P2WPKH ScriptSegWit version of P2PKHLower fees, limited compatibility
P2WSH ScriptSegWit version of P2SHLower fees, good for complex scripts
P2TR ScriptTaproot output typeLowest fees, best privacy, newest type
Multisig ScriptRequires multiple signaturesUsed for shared wallets, escrow

Transaction Size Calculations

ElementApproximate SizeNotes
Transaction Overhead~10-12 vbytesFixed overhead per transaction
Legacy Input (P2PKH)~148 vbytes eachHighest input size
SegWit Input (P2WPKH)~68 vbytes each~54% smaller than legacy
Taproot Input (P2TR)~57 vbytes eachSmallest standard input type
Standard Output~31-43 vbytes eachVaries by output type
Typical 1-in-2-out Transaction~225 vbytes (legacy)Simple payment with change
Typical 1-in-2-out Transaction~140 vbytes (SegWit)Simple SegWit payment with change
Typical 1-in-2-out Transaction~120 vbytes (Taproot)Simple Taproot payment with change

Digital Signatures and Verification

ComponentPurposeTechnical Detail
ECDSAOriginal signature algorithmUsed in legacy and SegWit transactions
SchnorrNewer signature algorithmUsed in Taproot transactions, more efficient
Signature Hash (SIGHASH)Determines what parts of TX are signedControls signature flexibility
SIGHASH_ALLSigns entire transactionMost common, prevents any changes
SIGHASH_NONEOnly signs inputsAllows output changes
SIGHASH_SINGLESigns inputs and corresponding outputAllows other output changes
SIGHASH_ANYONECANPAYModifier allowing input additionsCan be combined with other types

Advanced Transaction Features

Timelocks

TypeDescriptionUse Cases
nLockTimeEarliest time/block transaction can be includedTime-delayed payments, scheduled transfers
CheckLockTimeVerify (CLTV)Script-level absolute timelockSmart contracts, escrow with deadlines
nSequenceEnables relative timelocksRelative time constraints
CheckSequenceVerify (CSV)Script-level relative timelockPayment channels, Lightning Network

Transaction Privacy Features

FeatureDescriptionPrivacy Benefit
CoinJoinCollaborative transaction combining multiple inputs/outputsBreaks transaction graph analysis
PayJoinSpecial CoinJoin between sender and recipientDisguises payment amount
TaprootLatest Bitcoin upgrade with privacy enhancementsMakes complex scripts look like simple payments
Address Reuse AvoidanceUsing new address for each transactionPrevents linking of transactions
Coin ControlManual UTXO selectionPrevents revealing all holdings in single transaction

Transaction Replacement

MethodDescriptionWhen to Use
Replace-By-Fee (RBF)Replace transaction with higher-fee versionWhen initial fee too low for desired confirmation time
Opt-in RBFTransaction explicitly flagged as replaceableStandard approach, must be enabled at creation
Child-Pays-For-Parent (CPFP)New transaction with high fee to incentivize mining parentWhen transaction stuck but RBF not enabled
Package RelaySubmitting parent and child transactions togetherWhen parent won’t propagate due to low fee
Transaction AccelerationServices that prioritize specific transactionsEmergency situation requiring confirmation

Common Challenges and Solutions

Challenge: Transaction Stuck in Mempool

  • Solution: Use Replace-By-Fee (RBF) if enabled to increase fee
  • Solution: Create a child transaction spending the unconfirmed output with high fee (CPFP)
  • Solution: Wait for mempool to clear (can take hours to days)
  • Solution: Use transaction accelerator service (some miners offer this)
  • Prevention: Enable RBF when creating transactions, check mempool conditions before sending

Challenge: Sent to Wrong Address

  • Solution: If funds sent to your own mistyped address, they are likely lost
  • Solution: If sent to another person’s address, contact them and request return
  • Solution: If sent to exchange/service address, contact their support
  • Prevention: Always double-check addresses, use address book features, send test amount first

Challenge: High Transaction Fees

  • Solution: Wait for lower network congestion if not urgent
  • Solution: Use batching to combine multiple payments in one transaction
  • Solution: Upgrade to SegWit/Taproot wallet for lower fees
  • Solution: Use Lightning Network for small/frequent payments
  • Prevention: Check fee estimators before sending, schedule non-urgent transactions during weekends

Challenge: Transaction Shows Different Amount Than Expected

  • Solution: Verify if the difference is the transaction fee
  • Solution: Check if change went to a different address in your wallet
  • Solution: Confirm you’re looking at the correct transaction
  • Prevention: Review transaction details before signing, understand how change works

Best Practices for Bitcoin Transactions

Security Best Practices

  • Verify the first and last characters of destination addresses
  • Use hardware wallets for signing transactions with significant value
  • Enable address verification on hardware wallet display
  • Consider multi-signature for high-value transactions
  • Wait for appropriate confirmation count based on transaction value
  • Backup wallet before making transactions

Efficiency Best Practices

  • Use native SegWit (bc1) or Taproot (bc1p) addresses for lower fees
  • Batch multiple payments into single transactions when possible
  • Consolidate UTXOs during low fee periods
  • Set appropriate fee based on urgency (not always highest)
  • Enable Replace-By-Fee for all non-urgent transactions
  • Use Lightning Network for small or frequent payments

Privacy Best Practices

  • Never reuse addresses (generate new address for each transaction)
  • Avoid merging UTXOs from different sources in one transaction
  • Consider using CoinJoin for enhanced privacy
  • Separate coins by source/purpose using multiple wallets
  • Be cautious of timing patterns in your transactions
  • Consider transaction size when timing sensitive transactions

Technical Comparison: Transaction Types

FeatureLegacy (P2PKH)SegWit (P2WPKH)Taproot (P2TR)
Address FormatStarts with 1Starts with bc1Starts with bc1p
Input Size~148 vbytes~68 vbytes~57 vbytes
Fee EfficiencyLowestMediumHighest
CompatibilityUniversalHighGrowing
PrivacyBasicBasicEnhanced
Smart Contract SupportLimitedBetterBest
Signature AlgorithmECDSAECDSASchnorr
Adoption (2023)~10%~70%~20%

Resources for Transaction Management

Block Explorers

Fee Estimation Tools

Transaction Acceleration Services

Advanced Transaction Tools

This comprehensive cheat sheet covers the essentials of Bitcoin transactions. Remember that the Bitcoin protocol continues to evolve, and best practices may change over time. Always verify information with current sources before making significant transactions.

Scroll to Top