A hash function turns any input, any length, into a fixed-size output that looks random but is fully deterministic. Same input, same output, every time. Even a one-bit change in the input produces a totally different output. That property, called the avalanche effect, is what makes hashing useful.
Three properties
- Deterministic. Hash("hello") is always the same.
- One-way. Given an output, you cannot compute the input except by trying all possible inputs.
- Collision-resistant. Finding two inputs with the same hash is astronomically hard.
The main ones in crypto
- SHA-256. Bitcoin's hash. 256-bit output. Standardized by NIST.
- keccak256. Ethereum's hash. Same output size, different construction (SHA-3 family). Used in every address, storage slot, and event topic.
- Poseidon. A hash designed to be cheap inside zero-knowledge circuits. Used inside SNARKs and STARKs.
Where hashing shows up
- Transaction IDs (hash of the transaction).
- Block IDs (hash of the block header).
- Merkle trees (hashes of hashes).
- Digital signatures (you sign the hash, not the whole message).
- Commitments ("I know a value; here is its hash") for reveals and randomness.
Try it yourself
Below is a tiny demo that hashes any text with a simple non-cryptographic function so you can watch the avalanche effect. Change one character and watch every output digit change.
Why this matters daily
Every time your wallet says "transaction confirmed," what confirmed is a hash. Every time you check a transaction on Etherscan, you look it up by hash. Understanding hashes is like understanding numbers: nothing works without them.
Koinlytics