How Blockchain Works

Understand blockchain's core architecture: how distributed ledgers eliminate trusted intermediaries, how cryptographic hashing links blocks into an immutable chain, and why this matters for trading crypto assets intelligently.

Course 51: How Blockchain Works

Blockchain & Mining Track · 22 min read · All Levels

Every cryptocurrency you trade on an exchange — Bitcoin, Ethereum, Solana — exists as entries on a blockchain. Before you can intelligently evaluate why one asset holds value, why transaction fees spike at certain times, why mining difficulty matters, or why a network might fail under load, you need a working model of what a blockchain actually is. This is not background trivia. Understanding the architecture of the ledger your assets live on is as fundamental to intelligent crypto trading as understanding how an exchange order book works — covered in Course 4: How to Use a Crypto Exchange — or how on-chain flows signal accumulation and distribution, the subject of Course 47: On-Chain Analytics. This course builds that model from the ground up, using precise language without unnecessary abstraction. By the end you will understand why blockchains are considered immutable, how nodes reach consensus without trusting each other, and why this architecture has direct practical implications for how you manage positions, interpret fees, and evaluate the long-term security of assets in your portfolio.

The Problem Blockchain Solves: Double-Spend and the Trust Layer

Digital information is infinitely copyable. A JPEG can be duplicated. An email can be forwarded. A digital number representing "$100" could, in a naive system, be spent twice by simply broadcasting two transactions simultaneously. Before Bitcoin, every solution to this problem required a trusted intermediary — a bank, a payment processor, a clearinghouse — to maintain the authoritative record of who owns what. The intermediary's ledger is the ground truth. The problem is that this creates concentration of power: a single entity controls the ledger, can censor transactions, can be hacked, can fail, or can act in its own interest against its users.

Satoshi Nakamoto's 2008 white paper solved the double-spend problem without a trusted intermediary, using three interlocking mechanisms: (1) a public ledger replicated across thousands of independent computers; (2) cryptographic linking of records so that altering historical data becomes computationally infeasible; and (3) an economic consensus mechanism — proof of work — that aligns participant incentives to maintain the honest ledger. These three mechanisms together define the blockchain. Each is necessary; none is sufficient alone.

The Structure of a Block

A blockchain is, at its core, an ordered list of blocks. Each block is a data container with two sections: the block header and the block body.

The block body contains the transaction data — a list of all transfers recorded in that block. For Bitcoin, a typical block contains 1,500–3,000 transactions. These transactions are organised into a Merkle tree: transactions are hashed in pairs, those hashes are hashed in pairs again, and so on until a single root hash — the Merkle root — represents the entire transaction set. This structure allows compact verification: you can prove that a specific transaction is included in a block by providing only the branch of the tree leading to the root, without needing the full block data. This is how lightweight wallets (SPV clients) verify payments without downloading the entire blockchain.

The block header contains six fields:

  • Version: the protocol version used to construct this block, signalling which consensus rules apply.
  • Previous block hash: the cryptographic hash of the immediately preceding block header. This is the link that forms the chain — and the source of immutability.
  • Merkle root: the root hash of all transactions in this block's body.
  • Timestamp: the Unix time when the block was created (nodes tolerate some drift, but extreme timestamps are rejected).
  • Difficulty target: the current mining difficulty threshold, encoding how many leading zeros the block hash must have.
  • Nonce: a 32-bit number that miners iterate through exhaustively seeking a valid block hash. This is the variable adjusted by miners in the proof-of-work competition.
Bitcoin Block #820,000 — Internal StructureBLOCK HEADER (80 bytes)Version: 0x20000000Prev Hash: 000000...3f7aMerkle Root: a1b2c3...9f0eTimestamp: 1703980800Difficulty: 0x1703a30cNonce: 3,929,422,811BLOCK BODY2,476 transactions organised as Merkle treeSHA-256 DOUBLE HASHInput: 80-byte block headerHash1 = SHA-256(header)Hash2 = SHA-256(Hash1)Output must satisfy:0000000000000000000351...(19 leading zeros at this diff)Miner iterates nonce until met
Fig 1 — Bitcoin block structure. The 80-byte block header is double-hashed with SHA-256. A valid block must produce a hash with the required number of leading zeros (determined by current difficulty). Miners iterate the nonce value until they find one that produces a valid hash.

Cryptographic Hashing: The Chain's Backbone

The phrase "cryptographic hash function" deserves a precise definition because it does all the heavy lifting of immutability. A hash function takes an input of any size and produces a fixed-size output — for SHA-256, always 256 bits (64 hexadecimal characters). Four properties make SHA-256 suited for blockchain:

  1. Deterministic: the same input always produces exactly the same output. Given "Hello" you always get the same hash.
  2. One-way (preimage-resistant): given the output, you cannot reverse-engineer the input. SHA-256 is a trapdoor function.
  3. Avalanche effect: changing even one bit of the input produces a completely different output. There is no "close" in hashing — "Hello" and "hello" produce entirely different 64-character outputs.
  4. Collision-resistant: it is computationally infeasible to find two different inputs that produce the same output hash. The search space is 2256 — larger than the estimated number of atoms in the observable universe.

The previous block hash field in each block header is what creates the chain. Block 820,001 contains the hash of Block 820,000's header. Block 820,002 contains the hash of Block 820,001's header. To alter a transaction in Block 820,000, an attacker would need to recompute that block's valid header hash (requiring a full proof-of-work search), which would change the value referenced by Block 820,001, requiring that block's hash to be recomputed, cascading all the way to the current chain tip. To succeed, the attacker must outpace the entire honest network in real time. For Bitcoin at ~600 exahashes per second of total hashrate, this is economically and physically impossible. This is the mechanism of immutability.

Linked Block Chain — Each Block References Previous HashBlock #819,999Prev Hash: 000..ab3fMerkle Root: c4d5..77Nonce: 1,203,847,299Block Hash:000000...3f7a2,201 txnsBlock #820,000Prev Hash: 000..3f7a ←Merkle Root: a1b2..9fNonce: 3,929,422,811Block Hash:000000...8c2e2,476 txnsBlock #820,001Prev Hash: 000..8c2e ←Merkle Root: f7e9..4aNonce: 847,203,556Block Hash:Mining... ⛏pendinghash refhash ref
Fig 2 — Each block embeds the hash of the previous block header (blue arrows). Altering any transaction in Block 819,999 changes its hash, invalidating the “Prev Hash” pointer in Block 820,000 and cascading through all subsequent blocks.

Nodes: The Distributed Replication Layer

A blockchain is only meaningfully "distributed" if independent copies exist across many computers that do not trust each other. These computers are nodes. Bitcoin currently maintains approximately 17,000–20,000 reachable full nodes and likely many more non-advertising full nodes behind firewalls. Each full node independently validates every block and every transaction against the complete protocol rule set. No node is authoritative; consensus is emergent from the sum of independent validations.

Node types in the Bitcoin network:

  • Full nodes: download and independently validate the entire blockchain history from the genesis block forward. They enforce consensus rules, reject invalid blocks, and relay valid data to peers. Running a full node is the highest level of sovereignty — you do not trust any third party's interpretation of the chain state. A full Bitcoin node requires approximately 600 GB of disk space as of 2024.
  • Pruned nodes: validate all blocks but discard historical transaction data after validation to save disk space, retaining only the current Unspent Transaction Output (UTXO) set — the set of all unspent outputs that can serve as inputs to future transactions.
  • Lightweight (SPV) nodes: download block headers only and use Merkle proofs to verify transaction inclusion without processing full blocks. Most mobile wallets use SPV, accepting a trust trade-off for reduced resource requirements.
  • Mining nodes: full nodes that additionally participate in proof-of-work competition, constructing candidate blocks and searching for valid nonces. Their economic incentives and hardware requirements are covered in depth in Course 58: Bitcoin Mining Economics and Course 59: Mining Hardware & Pools.

The practical implication for traders: when you hold assets on a centralised exchange, you are not holding blockchain assets — you hold an IOU backed by the exchange's internal ledger. On-chain settlement only occurs when you withdraw to a self-custodied wallet. This distinction is why exchange inflow and outflow data is one of the most powerful on-chain signals available. When large amounts move from exchange wallets to private wallets, it typically signals accumulation and reduced near-term sell pressure. When assets move into exchanges, it often precedes selling. These patterns are explored in Course 60: Blockchain Analytics for Traders.

Consensus Mechanisms: How Agreement Is Reached Without Trust

A distributed system with no central authority needs a mechanism for reaching agreement on which version of the ledger is canonical when nodes hold conflicting views. Bitcoin uses Proof of Work (PoW): miners compete to find a nonce that makes their block's header hash satisfy the current difficulty target. The computational effort expended is the "work" — it is expensive to produce, trivially cheap to verify (one SHA-256 hash check), and Sybil-resistant (you cannot fake more hashrate without physical hardware and electricity). The chain with the most cumulative proof of work is treated as the canonical chain. The full mechanics of PoW are examined in Course 53: Proof of Work Explained.

Ethereum transitioned to Proof of Stake (PoS) in September 2022 (The Merge), replacing computational competition with economic stake as the Sybil resistance mechanism. Validators deposit 32 ETH as collateral. Dishonest validators are slashed — a portion of their stake is permanently destroyed. PoS reduces energy consumption by over 99% relative to PoW but introduces different security assumptions around validator concentration and capital requirements. The mechanics and trade-offs are covered in Course 54: Proof of Stake Explained.

Other mechanisms — Delegated Proof of Stake, Proof of History, Proof of Authority — each make different trade-offs across the security-decentralisation-throughput triangle. For traders evaluating Layer 1 assets, consensus mechanism choice directly affects block time, finality guarantees, throughput capacity, and the energy/capital profile of block production. These factors feed directly into the macro thesis of each network and its valuation model.

Transaction Lifecycle: From Broadcast to Settlement

Understanding how a transaction moves from your wallet to irreversible blockchain settlement demystifies mempool congestion, gas fees, and confirmation wait times — all of which directly affect trade execution in on-chain environments:

  1. Creation and signing: your wallet software constructs a transaction specifying inputs (UTXOs you control) and outputs (destination address, change address) and signs it with your private key. The signature proves control of the input without revealing the private key. The cryptographic mechanism behind this is covered in Course 52: Public vs Private Keys & Wallets.
  2. Broadcast: the signed transaction is propagated to the peer-to-peer network. Each node validates its syntax and signatures, then relays it to peers. Within seconds, a valid transaction has reached most of the global network.
  3. Mempool: unconfirmed transactions queue in the mempool of each node. During high-demand periods — halving events, DeFi yield farming frenzies, NFT mints — the mempool fills and fee competition drives inclusion costs sharply higher. Bitcoin mempool backlogs exceeded 500,000 transactions in early 2023. Ethereum gas prices reached 500+ Gwei during peak DeFi periods in 2021. Use the free DennTech crypto tools to estimate current break-even costs when transacting on-chain.
  4. Block inclusion: miners (PoW) or validators (PoS) select transactions from the mempool, typically prioritising by fee-per-byte or gas price. They construct a candidate block, solve the proof of work or stake-sign, and broadcast the complete block.
  5. Confirmation: each subsequent block added on top of your transaction's block adds one confirmation. For Bitcoin, the convention of six confirmations (~60 minutes) is accepted by major exchanges for large deposits. Ethereum's PoS finality is achieved after two epochs (~12.8 minutes), after which reversal requires burning at least one-third of the total staked ETH — an economically catastrophic event.

Public and Private Blockchains: Why the Distinction Matters

Not all blockchains are permissionless. The taxonomy matters for traders who follow enterprise adoption narratives:

  • Public permissionless blockchains (Bitcoin, Ethereum, Solana): anyone can read, transact, and participate in block production. No identity required. Censorship resistance is maximised. All transaction data is publicly visible and auditable — the foundation of the analytics techniques in Course 60.
  • Private permissioned blockchains: access restricted to known, vetted participants. Used by enterprises for supply chain, trade finance, and inter-bank settlement (Hyperledger Fabric, R3 Corda). These provide cryptographic integrity and auditability without public exposure. They are infrastructure platforms, not investable assets in the same sense as public chains.
  • Consortium blockchains: governed by a defined group of organisations rather than a single entity. Examples include major central bank digital currency (CBDC) pilot frameworks. These sit between public and private in the decentralisation spectrum.

For the purposes of this curriculum and the assets you will trade with the support of the DennTech free crypto calculators, all relevant assets are public permissionless blockchains. The scalability challenges of public chains — and the Layer 2 solutions designed to address them without sacrificing decentralisation — are covered in Course 56: Layer 1 vs Layer 2 Blockchains.

Practical Implications for Traders

Blockchain architecture is not background knowledge — it directly informs several live trading decisions:

  • Settlement finality and exchange deposits: different chains have different finality guarantees. Bitcoin requires six confirmations for large exchange deposits; Ethereum PoS finality takes ~12 minutes. Impatience here can expose you to the rare but real risk of an orphaned block invalidating an early credit.
  • Fee dynamics as demand signals: rising mempool congestion and gas prices are real-time signals of network demand. Sharp spikes in Bitcoin transaction fees often accompany bull market peaks. Use the no-signup crypto calculator tools at DennTech to model transaction costs against position size thresholds.
  • Security budget and long-term valuation: Bitcoin's long-term security depends on transaction fees replacing the block subsidy as halvings progressively reduce it toward zero. A weak security budget is an existential risk to the network and a legitimate bear case for long-term Bitcoin holders. This is examined in quantitative detail in Course 58.
  • On-chain supply dynamics: the UTXO set encodes every unspent coin. Age analysis of UTXOs (how long coins have been sitting unspent) is one of the most informative on-chain signals for gauging holder conviction and potential supply overhang. Covered in Course 60.

Summary

A blockchain is a distributed ledger secured by cryptographic hashing, replicated across independent nodes, and maintained through an economic consensus mechanism. Blocks are containers of ordered transactions, each cryptographically linked to its predecessor through the previous block hash field. The avalanche effect of SHA-256 makes historical alteration computationally infeasible, producing practical immutability proportional to accumulated proof of work or staked capital. Distributed replication ensures no single entity controls the ledger. Consensus mechanisms provide agreement on the canonical chain without a central authority. For traders, this architecture determines settlement finality, fee dynamics, censorship resistance, and the long-term economic security profile of every on-chain asset. The next course, Course 52: Public vs Private Keys & Wallets, descends to the cryptographic layer securing individual ownership: how private keys prove control without revealing the secret, how seed phrases give you a single master backup for every wallet you will ever need, and how to choose custody arrangements that match your risk profile and trading style.

Your Free Crypto Tools for This Course

The concepts introduced in this course connect directly to several of DennTech’s free crypto tools. There is no registration required to use any of them: