Tool · Blocks

Chain of blocks

Change one block and every later block breaks

A chain of blocks

Each block carries the hash of the one before it

Or edit any block’s text.
  1. #0valid

    prev00000000…

    hash364153cd…

  2. #1valid

    prev364153cd…

    hashf64fa108…

  3. #2valid

    prevf64fa108…

    hashcc973143…

  4. #3valid

    prevcc973143…

    hash051665a3…

  5. #4valid

    prev051665a3…

    hash1213537f…

Every block points at the real hash of the one before it: the chain is intact.

Real Pearl Re-linking was free here. In Pearl the block hash covers the 108-byte header, whose last field commits to a winning ticket, and that ticket came from a mining job keyed by the template, previous block’s hash included. Change a parent and the old ticket is worthless: every re-linked block has to be mined again, with new matrix work and a new certificate. That’s why old blocks get harder to rewrite with every block on top.

Toy header height ‖ previous hash ‖ SHA256d(text), hashed with SHA256d. Real headers are 108 bytes: version, previous block, Merkle root, time, bits, proof commitment.

Runs in your browser · nothing is sent src/lib/hash.ts · sha256d

What it does

Five toy blocks, each holding a line of text and the hash of the block before it. Each block’s own hash is SHA256d of a small header made of its height, that previous hash and a hash of its text.

How to read it

  • Edit any block’s text, or press Tamper with block 2. That block’s hash changes, so the next block’s “prev” no longer matches (struck through in red), and every block after it now sits on a broken block.
  • Re-link the chain points each later block at its parent’s new hash, one at a time. Each fix changes that block’s hash too, so the repair has to cascade to the end.

Pearl specifics

Here re-linking is free. In Pearl, a block hash covers the 108-byte header, whose last field commits to a winning ticket, and the ticket came from a mining job keyed by the template, previous block’s hash included. Change a parent and the old ticket is worthless: every re-linked block must be mined again. That is why history gets harder to rewrite with every block on top, and why nodes follow the chain with the most work.

What’s simplified

The header is a toy (height, previous hash, hash of the text). Real Pearl headers are 108 bytes: version, previous block, Merkle root, time, bits and proof commitment.

Under the hood

Runs entirely in your browser, with SHA256d from src/lib/hash.ts (unit-tested against real Pearl block and transaction hashes).

Suggested

Up and down arrows move through the results, Enter opens one, Escape closes. Anywhere on the site, slash or Command K opens this search, and the square brackets [ and ] go to the previous and next page.