Cryptographic Hash Function

An algorithm that turns any data into a fixed-length “digest” used to verify integrity, secure transactions, and power blockchains.

A cryptographic hash function is an algorithm that takes data of any length and deterministically produces a fixed-length output called a hash, or digest, often shown as a hexadecimal string. Even a tiny change in the input, such as altering one character, should produce a completely different output, making hashes useful as digital fingerprints for data.

Core properties and security goals

In blockchain systems, hash functions are relied on for integrity and tamper evidence rather than secrecy. A strong cryptographic hash function is designed to be one-way, meaning it is computationally infeasible to reconstruct the original input from the hash. It should also resist collisions, where two different inputs produce the same output, and resist second-preimage attacks, where an attacker tries to find a different input that matches a known hash. These properties let networks detect data manipulation quickly, since recomputing and comparing hashes is fast and straightforward.

How blockchains use hash functions

Hashing appears throughout crypto. Transaction data is hashed so nodes can verify that what they received matches what was originally broadcast. Wallet and account identifiers are commonly derived from hashed public key material, helping produce compact, standardized addresses.
Hashing is also central to block construction. Blocks typically include the hash of the previous block, creating a chain where changing older data would change its hash and break all subsequent links. In proof-of-work systems, miners repeatedly hash candidate block headers while varying a nonce, searching for an output that meets a difficulty target. This makes proposing a valid block costly, while verifying it remains cheap.
Cryptographic hash functions matter because they provide the foundation for blockchain immutability, efficient verification, and consensus security, enabling decentralized networks to agree on shared data without a central authority.