What Is a Hash and Why It Matters
The concept
Every blockchain claim you'll hear — "the transaction history can't be altered," "the block is tamper-evident," "the file hasn't been modified" — ultimately rests on one primitive: the cryptographic hash function. A hash function takes an input of any size (a word, a transaction, an entire gigabyte-sized file) and deterministically produces a fixed-size output, called a digest or hash. For SHA-256, the function Bitcoin uses, that output is always exactly 256 bits (32 bytes), no matter whether the input was one character or one terabyte. Ethereum's Keccak-256 and other chains' hash functions behave the same way structurally, even though the internal math differs — the properties that matter for a ledger are shared across all of them.
Three properties make this useful for a ledger. First, it's deterministic: the same input always produces the same output, every time, on every computer, forever. There is no randomness, no seed, no session state — run the same bytes through the same function a year from now on a different machine and you get the identical digest. Second, it's a one-way function: computing hash(input) = output is fast (microseconds), but going backward from output to recover input is computationally infeasible — not merely difficult, but infeasible in the sense that no known algorithm does better than brute-force guessing across an astronomically large search space. Third, it exhibits the avalanche effect: changing even a single bit of the input — one character, one comma — produces a completely different, unpredictable output. There is no "close" hash for a "close" input; a one-character edit to a 10,000-word document and a complete rewrite of that document produce equally unrelated digests.
This combination is what makes a hash a fingerprint rather than a summary. A summary approximates content; a fingerprint uniquely and verifiably identifies it. When a blockchain stores the hash of a transaction, a block, or a file, anyone — with no special access, no trust in the publisher — can recompute that hash from the original data and confirm it matches. If even one character changed, the hash won't match, and the discrepancy is immediately, mathematically obvious. That is the literal mechanism behind "tamper-evident": not that tampering is prevented, but that it cannot be hidden. This is also why hashes, not the raw data itself, are what get embedded in block headers — a 32-byte digest can represent a multi-megabyte block, making verification cheap even as the underlying ledger grows into gigabytes.
Why "infeasible" is a precise word, not a hedge
It's worth being concrete about what "computationally infeasible" means, because the word is easy to read as marketing language rather than a specific engineering claim. SHA-256 produces 256 bits of output, meaning there are 2²⁵⁶ possible digests — a number vastly larger than the count of atoms in the observable universe. Reversing a hash by brute force means trying inputs until one happens to produce the target digest; with current and foreseeable computing power, that search would take longer than the age of the universe many times over. This isn't a claim that reversal is merely inconvenient — it's a claim, backed by decades of cryptanalysis attempting to find shortcuts, that no shortcut faster than brute force is known for a well-designed hash function like SHA-256. That's the actual load-bearing assumption underneath "the blockchain is secure."
Worked example
Take the word "blockchain" and hash it with SHA-256:
import hashlib
def sha256_hex(data: str) -> str:
return hashlib.sha256(data.encode()).hexdigest()
print(sha256_hex("blockchain"))
# ef7797e13d3a75526946a3bcf00daec9fc9c9c4d51ddc7cc5df888f74dd434d5
print(sha256_hex("Blockchain")) # one capital letter changed
# a1b4d9e... (completely different digest — not a variant of the first)
Notice two things. First, both inputs — ten characters each — produced a 256-bit (64 hex-character) output of identical length; input size never affects output size. Second, capitalizing one letter didn't nudge the hash slightly; it scrambled it entirely. That's the avalanche effect in action, and it's why you can't infer anything about an input from its hash, or predict how a hash will change from a small edit.
This is exactly how a blockchain links blocks together: each block header contains the hash of the previous block's header. If anyone tried to edit a transaction buried ten blocks back, that block's hash would change — and because the next block embedded the old hash, the chain link would visibly break. Every subsequent block's embedded "previous hash" would now fail to match, exposing the tamper instantly to any node checking the chain. Rewriting history isn't blocked by a lock; it's exposed by broken arithmetic that propagates forward through every block since. An attacker wanting to alter old history would need to recompute every block's hash from that point forward, faster than the rest of the honest network extends the real chain — which is precisely the costly, resource-intensive task consensus mechanisms (covered in Module 3) are designed to make prohibitively expensive.
Try it yourself
Pick any sentence of your choosing — a line from a book, a sentence from this lesson — and run it through a SHA-256 calculator (many are free online, or use the Python snippet above). Then:
- Record the full 64-character hex digest.
- Change exactly one character (a comma, a capital letter) and hash it again.
- Compare the two digests character by character. How many characters are identical? (You should find the answer is close to random chance — roughly 1/16 per hex position — confirming there's no partial resemblance between "close" inputs.)
- Now hash the entire text of this lesson (or any long document) and separately hash just its first paragraph. Confirm both outputs are the same length despite wildly different input sizes.
- Finally, try hashing the same sentence twice in a row and confirm the outputs are identical — the deterministic property, verified directly.
This hands-on comparison is the fastest way to internalize why "the hash changed" is treated as absolute proof of tampering in every blockchain system you'll study from here on.

Recap
- A hash function maps any input to a fixed-size digest; it is deterministic, one-way (hard to reverse), and exhibits the avalanche effect (small input changes produce unrelated outputs).
- "Computationally infeasible" is a precise engineering claim, not a hedge: reversing SHA-256 would require searching a space of 2²⁵⁶ possibilities, far beyond any foreseeable computing power.
- This makes a hash a verifiable fingerprint: anyone can recompute it and detect even a single-character change, with no trust required in whoever published the original data.
- Blockchains chain blocks together by embedding each block's hash in the next, so tampering with old data breaks every subsequent link — the mechanism the next lesson (collision resistance and one-way functions) formalizes in more rigorous terms.