# What is a hash function?

A hash function turns any input into a short fingerprint of fixed size. The same input always gives the same fingerprint, and nobody can work back from it or find two inputs that share one.

Also called cryptographic hash, SHA-256 or BLAKE2.

## Where blockchains use them

Bitcoin and Ethereum addresses are hashes of public keys, blocks are chained together by their hashes, and a Merkle tree lets a single hash stand for thousands of transactions. Bitcoin uses SHA-256, and Ethereum uses Keccak-256.

## Why hashes are expected to outlast quantum computers

Quantum computers threaten cryptography built on algebraic structure, such as the elliptic curves behind wallet signatures. Against a good hash function the best known quantum attack only speeds up guessing, so a 256-bit hash such as SHA-256 is still considered strong. That is why researchers such as Justin Drake see hashes as the safest ground for what comes next.

## In Redacted

In bunker mode, notes, nullifiers, the note tree and every proof transcript use SHA-256, and the formats keep room for a second hash such as BLAKE2s. The proofs and the signatures are built from hashes too.

More: [Bunker mode](https://redacted.gg/docs/using-redacted/bunker-mode.md)

## Related terms

- [Merkle tree](https://redacted.gg/glossary/merkle-tree.md): A Merkle tree fingerprints a long list with one short value, the root, so that anyone can prove an item is in the list with a handful of hashes instead of the whole list.
- [STARK](https://redacted.gg/glossary/stark.md): A STARK is a zero-knowledge proof built from hash functions alone. It needs no trusted setup and no elliptic curves, so it is expected to hold up against quantum computers.
- [Post-quantum cryptography](https://redacted.gg/glossary/post-quantum-cryptography.md): Post-quantum cryptography is cryptography built to stay secure against quantum computers, which could break the elliptic curves and RSA that most wallets and websites rely on today.
- [Commitment](https://redacted.gg/glossary/commitment.md): A commitment locks in a piece of data without revealing it. Later it can be opened and anyone can check that it matches, but until then it gives nothing away and cannot be changed.

Sources: [Cryptographic hash function, Wikipedia](https://en.wikipedia.org/wiki/Cryptographic_hash_function), [SHA-2, Wikipedia](https://en.wikipedia.org/wiki/SHA-2)
---

Page: https://redacted.gg/glossary/hash-function/
