Bitcoin — Transactions and Mining

Section VI: Bitcoin Framework

Army Cyber Institute

April 9, 2026

Agenda

  • First, we start with wallets, keys, and addresses: what a Bitcoin user actually controls.
  • Next, we follow how a transaction is created, broadcast, and represented in the UTXO model.
  • Then, we examine blocks, mining, and how miners assemble and propagate valid blocks.
  • Finally, we connect confirmations, chain growth, and mining practice into one end-to-end system.

From Wallet to Block

  • This lesson follows two linked actions in Bitcoin: transactions and mining.
  • Users create and sign transactions; miners gather valid transactions into blocks.
  • Together, these actions move value, update the ledger, and secure the network.

Let’s start with what a Bitcoin user actually has: a wallet that manages keys, addresses, and the authority to spend Bitcoin.

What Are Wallets?

A user typically interacts with the Bitcoin network using a wallet, which serves several purposes:

  • Key manager: it creates or stores the private keys, often from a seed phrase.
  • Signer: it produces the digital signatures needed to authorize spending.
  • State viewer: it tracks which UTXOs and balances the user can control on-chain.
  • Applies spending policy: coin selection, fee estimation, change outputs, and address reuse rules.

Two important clarifications:

  • Wallets do not hold coins. Coins remain on-chain; the wallet holds the cryptographic authority to control them.
  • Backups and recovery matter: seed phrase security is often more important than the wallet interface itself.

Seed phrase: a human-readable backup phrase that a wallet can use to regenerate the private keys it manages.

Wallets, Addresses, and Keys

  • Wallets usually manage many keys and many addresses, not just one.

  • Addresses are typically derived from public keys, while the matching private keys let a wallet control value sent to those addresses.

  • Wallets often generate a new address for each transaction to improve privacy, as address reuse can leak information.

WalletModel cluster_addresses Addresses cluster_keys Keys cluster_utxos UTXOs wallet Wallet (manages many keys) k1 Private Key A + Public Key A wallet->k1 k2 Private Key B + Public Key B wallet->k2 k3 Private Key C + Public Key C wallet->k3 a1 Address 1 k1->a1 derive a2 Address 2 k2->a2 derive a3 Address 3 k3->a3 derive u1 UTXO 0.40 BTC a1->u1 locks value to u2 UTXO 0.15 BTC a2->u2 locks value to u3 UTXO 0.08 BTC a3->u3 locks value to

Where Addresses Come From

  • Wallets usually start from one seed phrase, then deterministically derive many private keys, public keys, and fresh addresses.
  • This lets one wallet recover and regenerate many addresses from one backup root.
  • The derivation happens locally in wallet software, not through any central registry or issuer.
  • Common address formats include legacy (1...) and SegWit (3... or bc1...).

WalletKeyFlow Seed Seed Phrase Priv Private Keys Seed->Priv derive many Pub Public Keys Priv->Pub compute Hash Hash160(pubkey) Pub->Hash hash Addr Addresses (Base58 / Bech32) Hash->Addr encode

Transactions and the UTXO Model

  • Bitcoin enters circulation in a coinbase transaction, the first transaction of every block.
  • That reward appears as an Unspent Transaction Output (UTXO) credited to that block’s miner.
  • A UTXO is a spendable output, like a receipt for a specific amount of bitcoin from an earlier transaction.
  • Wallet balances are the sum of the UTXOs a wallet can spend.
  • UTXOs are indivisible: each one must be spent in full or not at all.
  • Transactions use UTXOs as inputs and create new UTXOs as outputs.
  • New outputs usually go to the recipient and back to the sender as change.
  • Each UTXO is locked by a script, and spending it requires unlocking data (such as a valid digital signature and public key).
  • After signing a transaction, the wallet broadcasts it to the peer-to-peer network.

Smallest unit: One bitcoin can be divided into 100,000,000 satoshis, so 1 satoshi = 0.00000001 BTC.

UTXO Visualized

UTXO_Flow cluster_next After Inclusion in a Block cluster_prev Existing UTXOs (Unspent Outputs) cluster_tx Spending Transaction U1 UTXO A TXID:...:0 scriptPubKey (locks to Alice) I Inputs (ref TXID:index) U1->I SPENT Consumed: UTXO A, UTXO B (removed from UTXO set) U1->SPENT spent U2 UTXO B TXID:...:1 scriptPubKey (locks to Alice) U2->I U2->SPENT spent UNL Unlocking Data (scriptSig / witness) (signature + pubkey) I->UNL script checks NOTE2 Double-spend check: An output can be consumed at most once I->NOTE2 CORE Transaction Logic • verifies scripts • sums inputs ≥ outputs • includes fee UNL->CORE O1 Output #0 Recipient: Bob scriptPubKey (locks to Bob) CORE->O1 O2 Output #1 Change: Alice scriptPubKey (locks to Alice) CORE->O2 NEW1 New UTXO: O#0 (controls value for Bob) O1->NEW1 NEW2 New UTXO: O#1 (controls change for Alice) O2->NEW2

Why the UTXO Model?

  • Bitcoin does not track one mutable account balance; every spendable balance is a collection of UTXOs.
  • This makes validation simpler because each referenced output is either unspent or already spent.
  • It also supports cleaner transaction accounting and more parallel verification than an account model like Ethereum’s.

Example Transaction

  • Alice wants to pay Bob 1 BTC.
  • Alice controls UTXOs: 0.6 BTC + 0.7 BTC.
  • Does the math add up?
  • Why did the change go to a new address?

UTXOFlow U1 0.60 BTC UTXO (to Alice addr A1) from Tx alpha TX Transaction U1->TX input #1 U2 0.70 BTC UTXO (to Alice addr A2) from Tx beta U2->TX input #2 OB Bob 1.00 BTC TX->OB output #1 OC Alice (change) 0.29 BTC NEW address A3 TX->OC output #2

Change Addresses and Fees

  • Because UTXOs must be spent in full, any leftover value returns to the sender as change.
  • Wallets usually send that change to a new address they control, which helps reduce address reuse and improve privacy.
  • The miner fee is not a separate field in the transaction body.
  • The sender, usually through their wallet software, sets the fee by choosing how much value to leave unassigned to outputs.
  • Instead, the fee is the arithmetic difference: Inputs - Outputs.
  • In the previous example: 1.30 BTC in - 1.29 BTC out = 0.01 BTC fee.
  • A miner claims the fees from the block’s transactions by rolling them into that block’s coinbase transaction.
  • Higher fees usually give a transaction better priority for inclusion in a block.

Where Does a Transaction Go?

  • Transaction -> local wallet -> node -> mempool.
  • Mempool = holding area of unconfirmed transactions.
  • Miners choose which mempool transactions to include in a block.
  • Incentive: prioritize higher-fee transactions.

TxPath Wallet Wallet Node Full Node Wallet->Node Mempool Mempool Node->Mempool Miner Miner Mempool->Miner

End-to-End Transaction Flow

%%{init: {'sequence': {'diagramMarginY': 10, 'actorMargin': 30, 'messageMargin': 18, 'noteMargin': 8}} }%%
sequenceDiagram
participant U as Users (Wallets)
participant N as Full Nodes
participant M as Miner

U->>N: Broadcast signed transaction
N-->>N: Gossip to peers (mempool)
M->>M: Build candidate block from mempool<br/>Find PoW solution (hash < target)
M->>N: Broadcast new block
N->>N: Validate block & transactions
N->>M: Accept if valid
N->>U: Confirmations increase over time

When Is a Transaction Complete?

  • Once mined into a block: 1 confirmation.
  • Mining a new block usually takes about 10 minutes on average.
  • More confirmations = more security.
    • Chain reorganizations are possible in short windows. (Why?)
  • Exchanges and merchants often require 6 confirmations (about 1 hour).
  • Finality in Bitcoin is probabilistic, not instant.

Confirmations b1 1 b2 2 b1->b2 b3 3 b2->b3 b4 4 b3->b4 b5 5 b4->b5 b6 6 b5->b6 b7 7 b6->b7 b8 8 b7->b8 b9 9 b8->b9 b10 10 b9->b10 lab_newest Newest block gap_newest_a lab_oldest Oldest block gap_oldest_a gap_newest_b gap_newest_b->b1 gap_oldest_b gap_oldest_b->b10

Transaction Challenges

  • Slow confirmation: if fees are too low or the mempool is crowded, transactions may wait a long time before inclusion.
  • Probabilistic finality: merchants may not want to treat a payment as settled until several confirmations have passed.
  • Currency utility: that delay makes Bitcoin less convenient for instant, in-person payments than cash or cards.
  • Trade-off: Bitcoin gains global, decentralized security by accepting slower local settlement.
  • Price risk: if bitcoin’s price moves before finality, buyers and merchants face exchange-rate uncertainty during the wait.

The Data Structure of a Block

  • Each block contains a header (hash pointer to prior block, Merkle root, timestamp, nonce, etc.) and a list of transactions.

  • Hashes link blocks; changing history breaks the chain (tamper‑evident).

  • Merkle trees compress many transaction hashes into one for efficient verification.

  • A block header is only 80 bytes, but a full block can grow up to Bitcoin’s consensus limit of 4 million weight units (roughly up to about 4 MB, depending on transaction mix).

  • Structure enables scalability of verification, not infinite throughput.

BlockStructure block Block Header Version 4 bytes Hash ptr 32 bytes Merkle root 32 bytes Timestamp 4 bytes Target 4 bytes Nonce 4 bytes Transactions Coinbase Tx Tx Tx Tx ...

Transactions in a Block

  • Blocks can contain thousands of transactions.
  • Each transaction contributes to the Merkle tree.
  • Nodes validate every transaction before accepting the block.

Merkle TX1 TX1 HTX1 Hash(TX1) TX1->HTX1 TX2 TX2 HTX2 Hash(TX2) TX2->HTX2 TX3 TX3 HTX3 Hash(TX3) TX3->HTX3 TX4 TX4 HTX4 Hash(TX4) TX4->HTX4 H12 Hash(H1 || H2) HTX1->H12 HTX2->H12 H34 Hash(H3 || H4) HTX3->H34 HTX4->H34 MR Merkle Root H12->MR H34->MR

Mining a Candidate Block

  • Miners select valid pending transactions for a candidate block.
  • They add a coinbase transaction to claim subsidy and fees.
  • They hash the block header, mainly varying the nonce and related permitted fields.
  • The goal is a header hash below the current difficulty target.

MiningFlow s1 Users -> Full Nodes Broadcast signed transaction s2 Full Nodes Gossip to peers (mempool) s1->s2 s3 Miner Build candidate block from mempool Find PoW solution (hash < target) s2->s3 s4 Miner -> Full Nodes Broadcast new block s3->s4 s5 Full Nodes Validate block & transactions s4->s5 s6 Full Nodes -> Miner Accept if valid s5->s6 s7 Full Nodes -> Users Confirmations increase over time s6->s7

After Finding a Valid Block

  • Miner broadcasts block to peers.
  • Peers validate:
    • Proof-of-Work meets difficulty.
    • Transactions are valid and unspent.
    • Block builds on current longest chain.
  • Only then is the block relayed further.

Step1Flow s1 Users -> Full Nodes Broadcast signed transaction s2 Full Nodes Gossip to peers (mempool) s1->s2 s3 Miner Build candidate block from mempool Find PoW solution (hash < target) s2->s3 s4 Miner -> Full Nodes Broadcast new block s3->s4 s5 Full Nodes Validate block & transactions s4->s5 s6 Full Nodes -> Miner Accept if valid s5->s6 s7 Full Nodes -> Users Confirmations increase over time s6->s7

Adding to the Chain

  • If valid: the block is appended to a node’s local chain.
  • Competing valid blocks can create temporary forks.
  • The network converges on the chain with the most cumulative work.
  • Transactions gain confirmations as more blocks are added on top.

Step2Flow s1 Users -> Full Nodes Broadcast signed transaction s2 Full Nodes Gossip to peers (mempool) s1->s2 s3 Miner Build candidate block from mempool Find PoW solution (hash < target) s2->s3 s4 Miner -> Full Nodes Broadcast new block s3->s4 s5 Full Nodes Validate block & transactions s4->s5 s6 Full Nodes -> Miner Accept if valid s5->s6 s7 Full Nodes -> Users Confirmations increase over time s6->s7

Linking Blocks into a Chain

  • Each block references the hash of the previous block header.
  • Creates an immutable chain of history back to Genesis Block (2009).

Chain G Genesis Block Header Hash: h₀ B1 Block 1 Header Hash: h₁ Prev: h₀ B1->G B2 Block 2 Header Hash: h₂ Prev: h₁ B2->B1 B3 Block 3 Header Hash: h₃ Prev: h₂ B3->B2

Transactions and Mining Together

  • Transactions move value through the UTXO model.
  • Mining packages those transactions into blocks and secures their ordering.
  • Bitcoin works because spending, validation, incentives, and chain growth reinforce one another.

Evolution of Mining Hardware

  • In Bitcoin’s early years, ordinary CPUs could mine blocks; miners soon shifted to GPUs, which performed SHA-256 hashing much faster through parallel computation.
  • A brief FPGA phase followed, but by about 2013 specialized ASIC miners had become the practical standard because they were far faster and more energy efficient.
  • Modern Bitcoin mining is therefore an industrial activity: profitability depends heavily on efficient ASICs, cheap electricity, and cooling.
  • A block header nonce is only 32 bits, so miners eventually exhaust that search space; mining software then updates the coinbase extra nonce, rebuilds the Merkle root, and may refresh the timestamp within allowed bounds before hashing again.

Summary

  • Wallets manage keys, addresses, and the authority to spend UTXOs.
  • Bitcoin transactions consume old UTXOs, create new outputs, and move through nodes into the mempool.
  • Miners assemble candidate blocks, search for valid proof-of-work, and broadcast winning blocks to the network.
  • Full nodes validate those blocks, adopt the accepted chain, and confirmations increase as more blocks are added.

References

[1]
S. Nakamoto, “Bitcoin: A Peer-to-Peer Electronic Cash System.” Satoshi Nakamoto Institute, Oct. 31, 2008. Accessed: Sep. 12, 2025. [Online]. Available: https://cdn.nakamotoinstitute.org/docs/bitcoin.pdf
[2]
Bitcoin.org Developers, “Wallets (Developer Guide).” 2024. Available: https://developer.bitcoin.org/devguide/wallets.html
[3]
Bitcoin.org Developers, “Mining (Developer Guide).” 2024. Available: https://developer.bitcoin.org/devguide/mining.html
[4]
Bitcoin.org Developers, “Transactions (Developer Guide).” 2024. Available: https://developer.bitcoin.org/devguide/transactions.html
[5]
Bitcoin.org Developers, “Contracts (Bitcoin Developer Guide).” 2024. Available: https://developer.bitcoin.org/devguide/contracts.html
[6]
A. M. Antonopoulos, Mastering Bitcoin: Programming the open blockchain, Second edition. Sebastopol, CA: O’Reilly, 2017.
[7]
Bitcoin.org Developers, P2P Network (Developer Guide).” 2024. Available: https://developer.bitcoin.org/devguide/p2p_network.html
[8]
Bitcoin.org Developers, “Block Chain (Developer Guide).” 2024. Available: https://developer.bitcoin.org/devguide/block_chain.html
[9]
A. Neumueller, G. C. Pieters, K. Mohaddes, V. Rousseau, and B. Z. Zhang, “Cambridge Digital Mining Industry Report: Global Operations, Sentiment, and Energy Use.” Accessed: Oct. 28, 2025. [Online]. Available: https://www.ssrn.com/abstract=5236060