Bitcoin uses the SHA-256 cryptographic hash function for its proof-of-work mining.
SHA-256 belongs to the SHA-2 family of secure hash algorithms standardized by the United States National Institute of Standards and Technology. Bitcoin miners repeatedly hash block-header data, changing a value called a nonce until the resulting hash satisfies the network’s current difficulty target. Because the output is difficult to predict, finding a qualifying hash requires substantial trial and error.
Bitcoin applies SHA-256 twice in several parts of its design, including the proof-of-work calculation commonly described as double SHA-256. A hash is a fixed-length output, not an encrypted version of the input, so it cannot simply be decrypted to recover a message.
The mining algorithm is sometimes confused with the algorithm used by other cryptocurrencies. Litecoin, for example, is associated with Scrypt, while Bitcoin uses SHA-256. The function does not alone make Bitcoin decentralized; the network’s consensus rules, economic incentives, and distributed participants work together.