Crypto glossary

SHA-256

Definition

SHA-256 is a cryptographic hash function designed by the US NSA that turns any data into a 256-bit value; Bitcoin uses it for mining and to link blocks.

SHA-256 belongs to the SHA-2 family, published as a US federal standard in 2001. It takes input of any length and outputs a 256-bit hash, usually written as 64 hexadecimal characters. No practical way is known to reverse it or to find two inputs with the same output, which is why it is widely used in web security and software signing.

Bitcoin applies SHA-256 twice in a row, often called double SHA-256, to hash block headers and transactions. Miners compete to find a header whose hash is below the difficulty target, and specialised ASIC chips do nothing but compute SHA-256 at enormous speed. Bitcoin Cash and several other coins use the same algorithm, so the same machines can mine them.

Quantum computers are not expected to break SHA-256 in a practical way; the larger quantum concern for Bitcoin lies with its signature schemes. A more immediate risk of a shared algorithm is that hashrate can move between coins, exposing a smaller SHA-256 chain to a 51% attack.

Example

A modern Bitcoin ASIC can compute well over 100 trillion SHA-256 hashes per second, all searching for a block header that meets the target.

Related terms