← Back to Glossary

SHA-256

SHA-256 is a cryptographic hash function that converts input of any size into a fixed 256-bit output. Designed at the National Security Agency and published by the United States standards body NIST in 2001, it is deterministic, fast to compute, and practically impossible to reverse, with 2^256 possible outputs.

Why it matters

Bitcoin is built out of SHA-256 at every level: transaction identifiers, the Merkle trees that summarize blocks, address derivation, and above all mining, where the function is applied twice to block headers in the proof-of-work lottery. The entire mining industry, by the mid-2020s computing on the order of hundreds of quintillion hashes per second, is dedicated hardware for this one function. Its security assumptions have held since publication, with no practical collision or preimage attack known despite a quarter century of cryptanalysis and the largest bug bounty in history implicitly resting on it.

How it works

The function pads its input, splits it into 512-bit blocks, and runs each through 64 rounds of mixing operations that combine bit shifts, additions, and logical functions, folding every block into a running 256-bit state. A one-character change in the input flips roughly half the output bits, the avalanche effect that makes outputs statistically indistinguishable from random. Mining exploits this randomness: since no shortcut predicts which header variation will hash below the target, miners can do nothing smarter than guess, and expended electricity becomes measurable proof of work.

Ready to convert your gold to Bitcoin?

Get Your Free Kit →