SHA-256

cryptography · beginner

The cryptographic hash function Bitcoin uses everywhere — block hashing, address derivation, signatures, all of it.

SHA-256 is part of the SHA-2 family, published by NIST in 2001. It takes any input and returns a 256-bit output. Bitcoin uses it twice for block headers ("double-SHA-256") and as part of HASH160 (SHA-256 then RIPEMD-160) for legacy addresses.

Internally, SHA-256 processes data in 512-bit chunks through 64 rounds of bit-level mixing — XOR, AND, rotation, and modular addition. Each round depends on every previous round, which is what makes the function avalanche: a single bit flip in the input cascades through the rounds and changes ~50% of the output bits unpredictably. There's no shortcut faster than the round-by-round computation.

ASIC miners are essentially specialized hardware for running SHA-256 at maximum throughput per joule. The reason the function makes such good proof-of-work is that it's *fast on purpose* — a fast function with no shortcut means brute force is the only attack, and brute force is what we're paying miners to do.

Related terms

Where you'll see this