network

SHA-256

The cryptographic hash function at the heart of Bitcoin mining and block creation. SHA-256 converts any input into a unique 256-bit fingerprint and is computationally irreversible, making it the foundation of Bitcoin's proof of work.

SHA-256, short for Secure Hash Algorithm 256-bit, is a cryptographic hash function that takes any input and produces a fixed-length 256-bit output, typically represented as a 64-character hexadecimal string. The function is one-directional: given an input, computing its hash is fast and deterministic, but reversing the process — finding the original input from just the hash — is computationally infeasible with current technology. Even a single character change in the input produces a completely different output, a property known as the avalanche effect.

Bitcoin uses SHA-256 in two critical ways. In mining, nodes compete to find an input value (the nonce) that, combined with the block data, produces a hash below a target threshold — a process that requires enormous computational effort but can be verified instantly by anyone. This is the core mechanism of proof of work. SHA-256 is also used to chain blocks together: each block contains the hash of the previous block, making any retroactive alteration of history detectable immediately.

SHA-256 was developed by the United States National Security Agency and published in 2001. As of today, no practical attacks against SHA-256 are known. The theoretical concern from quantum computing, specifically an algorithm called Grover's algorithm, does not apply to SHA-256 in the same way it does to asymmetric cryptography. The Bitcoin community actively monitors cryptographic research to assess whether the function's security assumptions remain valid over time.

Frequently asked questions