Overview
A cryptographic hash is a mathematical function that converts any input into a fixed-size string of characters, usually shown as a hexadecimal number. It is deterministic, meaning the same input always produces the same hash, and it is a one-way function, meaning the original input cannot be recovered from the hash. Hashes are the building block of blockchain data integrity.
How It Works
Hash functions such as SHA-256 take an arbitrary input and produce a fixed-length digest. Two properties make them valuable for blockchains: even a tiny change to the input produces a completely different hash, and finding an input that produces a given hash is computationally infeasible. Blocks link to each other by embedding the previous block's hash, so altering any historical block would invalidate every subsequent hash.
Why It Matters
Hashing gives blockchains tamper evidence. Transaction and block hashes let anyone verify that data has not been altered, and hash-based commitment schemes underpin Merkle trees, proof-of-work mining, and zero-knowledge proofs. For users, transaction hashes (txids) are the reference identifier shown on every block explorer.
Related Concepts
Hashes link Blocks into the chain and identify Transactions on explorers. They are also the core primitive behind Proof of Work, Merkle tree commitment in rollups, and Zero-Knowledge Proofs.