Blockchain Framework – Beginner Lab 3

Simple Blockchain Framework Lab 3

This lab shows a chain of 10 blocks. Each block has: Data (what we store), a Nonce (a number we change), a Prev Hash (link to the previous block), and its own Hash (a fingerprint). If you change the Data or Nonce in one block, all blocks after it will break until you re-mine them.

Valid block   •   Invalid – hash doesn’t match difficulty or previous link
Framework explained (for absolute beginners)
  • 1. A block = a record. Think of a block as a row in a ledger: it stores data plus some extra security fields.
  • 2. Hash = fingerprint. The hash is created from index + previous hash + nonce + data. If anything changes, the hash changes.
  • 3. Prev Hash connects the chain. Each block stores the hash of the block before it. This is how we “chain” the blocks together.
  • 4. Difficulty = how strict we are. We require the hash to start with a certain number of zeros (for example 000...). Higher difficulty = harder to find a hash.
  • 5. Mining = trying nonces. When you click Mine, the demo keeps changing the Nonce until the hash starts with enough zeros.
  • 6. Immutability. If you change the Data in Block 3, its Hash changes, which breaks Block 4’s Prev Hash, then Block 5, and so on. This is why blockchains are tamper-evident.
  • 7. Valid vs Invalid. Green edge = valid (hash meets difficulty and link is correct). Orange/red edge = invalid (something is off).

Use this as a mental model: “A blockchain is just a list of records where every record points securely to the one before it.”

Difficulty (number of leading zeros required in the hash):