Back to lessons

Chapter 3 - 0 of 10 quizzes passed

Hashes: Digital Fingerprints

A cryptographic hash is a one-way function that makes tampering visible and proof of work possible.

  • Explain what a cryptographic hash does and why the avalanche effect matters
  • Describe how a merkle root commits a block to all of its transactions

One-way fingerprints

A cryptographic hash function takes any input — a word, an image, an entire encyclopedia — and returns a fixed-size digest. The process is one-way: you can verify that the input produces the digest, but you cannot practically work backwards from the digest to the input. Bitcoin uses SHA-256, which returns 256 bits, usually written as 64 hexadecimal characters. Block hashes and transaction IDs apply it twice (SHA-256d).

The avalanche effect

A good hash function is highly sensitive. Change one comma in a 500-page document and the digest changes completely. This is called the avalanche effect. It is what makes hashes useful as commitments: the digest locks in the exact bytes, and any later change is obvious.

The merkle root

A block does not hash every transaction into the header one by one. It hashes pairs of transaction IDs, then pairs the results, and repeats until one hash remains: the merkle root. The block header contains its version, that root, the previous block hash, time, difficulty target, and nonce. Change any transaction and the merkle root changes, which changes the header hash and breaks the chain of later work.

Tamper-evident history

Each block header includes the hash of the previous header. To rewrite an old transaction, an attacker would have to redo that block’s proof of work and every block after it, faster than the honest network. The hash chain makes history easy to verify and expensive to rewrite. Nodes reject invalid blocks, but they follow a valid competing chain with greater accumulated work. A node cannot reject a valid chain with more work just because an attacker built it.

Try it

SHA-256(message)f8e77d5916b5ee492c961e2883b02f8fad5ceb179e7ff67d787b298ea5b54c00
SHA-256(message + !)a8e41f86810384a4a7d5336c750683604dbe2bcf41fe3820ab3db921ffdb63d8

135 of 256 bits changed after adding one character.

What you should take away

Hashes are one-way commitments. The merkle root commits a block to all of its transactions, and each header commits to the previous block, so changing history requires redoing the work above it.

Retrieve, then apply

Change one character in the demo. What changes, and what does the hash not prove?

Check your explanation

The digest changes substantially. A matching digest checks data consistency; it does not prove the data is true or authorized. Authorization needs signatures.

Checkpoint

Question 1 of 3

Someone edits one transaction inside a block buried 100 blocks deep. What gives the edit away?

Question 2 of 3

You hash a document, change one comma, and hash it again. What happens to the digest?

Question 3 of 3

What does a block’s merkle root commit to?

Sources

Reviewed 2026-10-25 · not financial advice