⛓️ Blockchain Mechanics Lab Local PoW Validity

Peer Node:
Scenarios:
Active Peer State All 5 Blocks Valid
Hash Target 000...
Mining Hashrate 0 H/s
Locally PoW-Valid Peers 3 / 3 (100%)
Interactive Experiment: Edit any transaction amount or sender below in Block #2. Watch the SHA-256 hash and later reconstructed hash inputs change; old nonces may no longer meet the prefix. Click Mine to compute a valid Proof-of-Work nonce!
🌳 Merkle Tree Root Inspector (Selected Block: #1)

Transactions in a block are cryptographically combined pairwise into a binary Merkle Tree. Changing a transaction changes its hash input and normally the top root. This is a simplified text-hash tree.

🌐 3-Peer Local Validity Matrix

The percentage counts locally prefix-valid peers, not agreement on a shared tip. Copy First Valid Chain selects the first qualifying peer in A, B, C order; no chain-work comparison occurs.

Separate hash validity from network agreement

What does a valid hash prove in this five-block illustration, and what does it leave unchecked?

Each browser-local peer holds five example blocks. SHA-256 hashes the transaction strings into a simplified Merkle root, then hashes the block index, timestamp, reconstructed previous hash, root and nonce. Mining searches for a hash with the selected leading hexadecimal zero characters. No wallet, blockchain network or transaction is contacted.

This is a local illustration, not Bitcoin consensus software. It does not verify signatures, balances, spending rights, double spending, network messages or cumulative chain work. The valid-peer percentage counts each peer passing the local hash-prefix checks; different valid tips can still produce 100%. Example amounts are data strings, not transferable funds.

Try a worked example

At difficulty 3, the target is three leading hexadecimal zero characters. Under an ideal uniformly distributed hash model, a trial has chance 1 / 16³ = 1 / 4096, so the expected trials are 4096; any particular search may finish sooner or later. Difficulty 2 expects 256 trials, and difficulty 4 expects 65,536. These are expectations, not measurements of mining speed or security.

Read the exact data being hashed

A transaction leaf hashes the UTF-8 text from->to:value, such as Alice->Charlie:25. Two leaf hash strings are concatenated and hashed to form their parent; an odd final leaf is duplicated. With no transactions, the root is SHA-256 of EMPTY. A header hashes index|timestamp|previousHash|merkleRoot|nonce. Exported full hashes let you inspect this exact recipe.

Web Crypto digest provides the actual SHA-256 calculation. This application uses its own text serialization and a single SHA-256 operation at each step; it does not serialize Bitcoin transactions or block headers. A transaction name is not a public key, and a digest is not a digital signature. MDN: Web Crypto digest

Try a change, then repair the example work

Change a Block 2 transaction or use Tamper Block 2. Its root and header hash change, and later hashes are recalculated using those new results. The old nonces may fail the selected prefix. Mine searches a replacement nonce for the active block; Mine Entire Chain processes all five in order.

Previous hashes are reconstructed during evaluation rather than retained as independent block commitments. A block’s local validity checks its own proof of work; it does not require every earlier block to be valid. Consequently a later block may display valid by chance even after an earlier edit. The simulator illustrates changing hash dependencies, not all validation rules of a real ledger.

Distinguish rewriting two peers from a 51% attack

The two-peer rewrite action replaces one transaction in Nodes A and B with Attacker->Alice:50000 and remines each peer, including unchanged Node C. All chains stay five blocks long. Validity can be3/3 while Node C’s tip differs. Copy First Valid Chain takes the first locally valid peer in A, B, C order and copies it to every peer; it does not select a longest branch or compare accumulated work.

The Bitcoin paper discusses proof-of-work competition, transaction validation and competing histories. Its majority assumption concerns computational power, not simply two of three displayed node names. This example has no hashpower shares, propagation delays, confirmation-depth probability or economic attack model. Bitcoin: A Peer-to-Peer Electronic Cash System

Interpret mining, resetting and exporting

The difficulty menu changes how many leading hex zeroes are required; it does not automatically remine existing nonces. The H/s display is the local search’s counted digest calls divided by elapsed browser time, not an ASIC or network benchmark. Mining consumes browser computation but does not earn rewards.

Reset restores the five example records for all peers and remines at the currently selected difficulty; it does not reset difficulty or the active peer tab. JSON exports only the active peer, the selected difficulty and this application’s computed roots, links and validity flags. It is not an export of all three peers or a Bitcoin-compatible chain.

Sources and further reading
Super generates helpful tools and automates fact-checking across the internet proactively. If you enjoyed this tool, build your own with Super and share it with a friend.