Skip to content

Foundations of Blockchain Technology

Back to subtopics

Anatomy of a Block

Block Demo ~6 minMedium

Header fields: prev hash, Merkle root, timestamp, difficulty, nonce. PoW searches nonce for target.

Previous hash
Links to the parent block (chain structure).
Merkle root
Represents all transactions compactly.
Nonce & difficulty
Miner searches nonce so hash has leading zeros.
Detailed Notes
Key Highlights
  • Block Structure: Each block contains a header with metadata (previous hash, Merkle root, timestamp, difficulty target, nonce) and a body containing the list of transactions included in that block.
  • Proof of Work Mining: Miners repeatedly modify the nonce field and compute the block hash until the resulting hash is below a target difficulty value (indicated by leading zeros). This process is computationally expensive but easy to verify.
  • Block Linking: The previous hash field in each block header creates a cryptographic link to the parent block. Altering any historical block would require redoing all subsequent mining work, making the chain tamper-evident.

A block serves as the fundamental unit of blockchain data, encapsulating both metadata about the block itself and the transactions it contains. The block header is critical—it contains the hash of the previous block, creating an immutable chain structure. The Merkle root field provides a cryptographic commitment to all transactions in the block's body, allowing efficient verification of transaction inclusion. The timestamp records when the block was mined, helping nodes synchronize and preventing timestamp manipulation. The difficulty target specifies how "hard" the proof-of-work must be—lower targets mean more leading zeros are required in the hash, exponentially increasing the computational effort. Miners engage in a brute-force search through nonce values, hashing the block header repeatedly until finding a nonce that produces a hash meeting the difficulty requirement. This process consumes significant computational resources but ensures that creating blocks is expensive, making attacks economically infeasible. Once a valid block is found, it's broadcast to the network, where other nodes verify both the proof-of-work and all included transactions before accepting it into their copy of the chain.

Block Header Components
  • Previous hash: Links to parent block (creates chain)
  • Merkle root: Cryptographic commitment to all transactions
  • Timestamp: When block was created (helps prevent manipulation)
  • Difficulty: Target hash value miners must beat
  • Nonce: Field miners modify during mining process
Mining Economics
  • Cost: Electricity and hardware for hash computation
  • Reward: Block subsidy + transaction fees incentivize mining
  • Competition: Higher network hashrate increases difficulty
Block Validation
  • Verify proof-of-work: Check hash meets difficulty target
  • Verify transactions: Ensure all transactions are valid
  • Check Merkle root: Ensure it matches computed root
  • Verify chain linkage: Previous hash must match parent block
Security Properties
  • Tamper-evidence: Changing any data breaks hash chain
  • Economic security: Cost to attack exceeds potential gain
  • Decentralization: Many independent miners prevent control
Presenter Notes
  • Increase difficulty to show exponential growth in attempts.
  • Change data to illustrate Merkle root impact.