What is Hash Function?

1 min read Updated

A cryptographic hash function is a one-way mathematical function that converts arbitrary input into a fixed-length output — deterministic, collision-resistant, and fundamental to blockchain security.

WHY IT MATTERS

Hash functions are the glue of blockchain. They produce fixed-length fingerprints from any input, with key properties: deterministic (same input → same output), one-way (can't reverse), collision-resistant (can't find two inputs with same output), and avalanche effect (tiny changes cause massive output changes).

Blockchains use hashes everywhere: block hashing (creating the chain), transaction IDs, Merkle trees, address derivation, and proof-of-work mining.

Bitcoin uses SHA-256; Ethereum uses Keccak-256. Both provide 256-bit security — finding a collision would require ~2^128 operations, well beyond any feasible computation.

FREQUENTLY ASKED QUESTIONS

Can hashes be reversed?
No. Hash functions are one-way by design. You can verify by re-hashing the input, but cannot determine input from output.
What is a hash collision?
Two different inputs producing the same hash. For SHA-256, probability is ~1 in 2^256 — computationally impossible with current and foreseeable technology.
Why do different chains use different hash functions?
Design choices. SHA-256 (Bitcoin) was the standard when Bitcoin launched. Keccak-256 (Ethereum) was chosen from the SHA-3 competition for its different construction, providing algorithm diversity.

FURTHER READING

Enforce policies on every tool call

Intercept is the open-source MCP proxy that enforces YAML policies on AI agent tool calls. No code changes needed.

npx -y @policylayer/intercept
github.com/policylayer/intercept →
// GET IN TOUCH

Have a question or want to learn more? Send us a message.

Message sent.

We'll get back to you soon.