Skip to main content

SHA-256

hashing · btc · bch

A 256-bit cryptographic hash function used for transaction IDs, Merkle trees, and proof of work.

1.definition

SHA-256 is a member of the SHA-2 family of cryptographic hash functions. It takes input data of any size and deterministically produces a 256-bit output, while making it computationally infeasible to recover the input or find two useful inputs with the same hash.

2.usage

Bitcoin and Bitcoin Cash use double SHA-256 in proof-of-work mining and transaction identifiers. Miners repeatedly hash block headers with different nonces until the resulting value is below the current difficulty target.

3.properties

SHA-256 is a hash function, not encryption: it does not hide data in a reversible way. Its key properties for blockchains are determinism, preimage resistance, collision resistance, and the avalanche effect. A hash alone does not authenticate who supplied the data; that requires a trusted commitment, signature, or other context.

For the distinction between hashing and encryption, start with cryptographic hashes. The homepage hash playground lets you test SHA-256 with your own message.

Related terms

All terms and definitions may update as the Cryptionary improves.