A cryptographic hash is the fixed-size output, also called a hash value or digest, that a cryptographic hash function computes from an input. The function is designed to be one-way, meaning the input is infeasible to recover, and collision resistant, meaning finding two different inputs that share an output is designed to be infeasible. Bitcoin uses hashes for proof of work and block links.
What Does a Cryptographic Hash Function Do?
A cryptographic hash function is an algorithm that works like a fingerprint machine. It condenses data of any practical length, such as a word, a file, or a Bitcoin transaction, into a fixed-size fingerprint, and the same data always produces the same fingerprint. The function is designed to be easy for a computer to compute.
People call the output a cryptographic hash, a hash value, or a digest, and standards from the National Institute of Standards and Technology (NIST) also say message digest. Computing a cryptographic hash is called hashing, or cryptographic hashing.
The table below applies Secure Hash Algorithm 256 (SHA-256), one widely used cryptographic hash function, to two inputs of very different length. Each hash value has 64 hexadecimal characters. Hexadecimal is base-16 notation in which one character stands for 4 bits, so 64 characters equal 256 bits.
| Input | Input length (characters) | SHA-256 hash value |
|---|---|---|
abc | 3 | ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad |
abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq | 56 | 248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1 |
Which Properties Make a Hash Cryptographic?
A cryptographic hash is deterministic. The same input gives the same hash value on every computer, every time, so anyone can recompute a hash and compare it with one they were given.
A cryptographic hash has a fixed length. Short and long inputs both produce an output of the same size: in SHA-256, a 3-character input and a 56-character input each give 256 bits.
A cryptographic hash is designed to be preimage resistant, which makes the hash function a one-way function. Given only a hash value, finding any input that produces it is meant to be computationally infeasible. In plain terms, computing a hash value is easy, and recovering the input is designed to be infeasible.
A cryptographic hash is designed to be second-preimage resistant. Here the attacker starts with a known input and its hash value, and the task is to find a different input that gives the same hash value. This differs from preimage resistance, where the attacker holds only the hash value.
A cryptographic hash is designed to be collision resistant. A collision is two different inputs that give one hash value, and in this property the attacker may choose both inputs. Collisions must exist, because there are more possible inputs than possible outputs: SHA-256, for example, has 2 to the power of 256 possible hash values. This property, collision resistance, means that no one is expected to find a collision in practice, not that none exists.
A cryptographic hash shows an avalanche effect. A small change to the input changes the hash value unpredictably. Changing “abc” to “abd” changes 122 of the 256 bits in the SHA-256 hash value, even though only one character differs.
How Does a Cryptographic Hash Differ from a Checksum, Encryption, and a Signature?
A cryptographic hash differs from a checksum in its design goals. A checksum is a value computed to catch accidental changes, such as data damaged in transfer. A person who changes both the data and its checksum can pass that check, so a checksum alone gives no protection against deliberate tampering. A checksum does not need to be one-way or collision resistant for that job, while a cryptographic hash function is designed to be both.
A cryptographic hash is not encryption. Encryption changes readable data into ciphertext with a key, and whoever holds the key can reverse it. An unkeyed cryptographic hash function, such as SHA-256, takes only the data as input and is designed to be one-way, so there is nothing to decrypt. Phrases such as “hash encryption” or “decrypt a hash” mix up two different tools.
A cryptographic hash is not a digital signature. A digital signature uses a private key to sign and a public key to check, and it can confirm both the origin and the integrity of data. Hashing is typically part of signing: the message is hashed first, and the signature function then processes the hash value instead of the whole message.
What Do Hash Functions Do in Bitcoin?
Hashing in crypto does concrete work in Bitcoin, which relies on hash functions in five main places. Bitcoin usually applies SHA-256 twice, which is called double SHA-256: the function runs once on the data, then again on its own output.
Transaction IDs. A transaction ID is the double SHA-256 hash of the transaction’s serialized data, not counting the witness data of Segregated Witness (SegWit) transactions. A transaction ID therefore changes if an input or output of the transaction changes.
Merkle tree. A Merkle tree is a structure that condenses many hashes into one. Bitcoin hashes transaction IDs in pairs, level by level, until a single hash remains. That hash is the Merkle root, and it summarizes every transaction in the block. The block header is an 80-byte summary of a block, and it stores the Merkle root.
Proof of work. In Bitcoin mining, a miner hashes the block header. The header holds a version number, the hash of the previous block’s header, the Merkle root, a timestamp, an encoded form of the target, and a nonce. The nonce is a number the miner changes on each attempt. The target is a threshold set by Bitcoin’s rules, and a header is valid only if its double SHA-256 hash value, read as a number, is at or below the target.
Block links. A cryptographic hash links one block to the next. Each block header stores the hash of the previous block’s header, in a field named the previous block header hash, and that field chains the blocks in order.
Addresses. A cryptographic hash also helps build addresses. Legacy and SegWit single-key addresses are derived by hashing a public key with SHA-256 and then with RIPEMD-160. RIPEMD-160 is a second hash function with a 160-bit output. Script-hash and Taproot addresses are built differently, so not every Bitcoin address follows this pattern.
Why Does Hashing Make Blockchain History Tamper-Evident?
A cryptographic hash makes a change to old blockchain data visible, because the hashes in each block depend on each other. Suppose someone alters an input or output of one transaction in an old block. Four things follow in order:
- The transaction’s ID changes, so the Merkle root of that block changes.
- The block header holds the Merkle root, so the hash of that header changes.
- The next block stores the old header hash in its previous block header hash field, and the stored value no longer matches the recomputed one.
- To make the chain consistent again, every later block would have to be rebuilt, and each one needs its proof of work redone.
Because a cryptographic hash is deterministic, anyone with copies of the blocks, including a full node, can recompute a header’s hash and compare it with the value stored in the next block. A full node is a computer that runs Bitcoin software, stores the chain, and checks received blocks against the consensus rules.
Verifiability is the ability of network participants to verify any transaction or block themselves. Hashing contributes to verifiability, because any participant holding copies of the blocks can repeat that hash comparison.
Immutability is a blockchain network’s resistance to censorship and change. Hashing contributes to the resistance to change by making altered history visible.
Tamper-evident is not the same as tamper-proof. Hash-linked blocks make a change visible and expensive to redo, but they do not make a change logically impossible. Hashrate is the number of hashes the network computes each second. A group that controlled a majority of the network’s hashrate could reliably rewrite history.
What Does a Cryptographic Hash Not Tell You?
A cryptographic hash can show that data changed, but not who made or changed it. Authorship is the job of a digital signature.
A cryptographic hash does not make a weak input safe. Reversing a hash value is computationally infeasible, but anyone can hash guesses and compare the results. Because a hash function is easy to compute, a short or common input, such as a simple password or a four-digit PIN, is typically found quickly.
A cryptographic hash function is designed to be one-way and collision resistant. These are design goals, which NIST describes as expected properties of such a function, not proven guarantees.
A hash function can be weakened over time, and SHA-1 is a documented case. NIST deprecated SHA-1 in 2011 and disallowed it for digital signatures at the end of 2013. In February 2017, researchers from the Centrum Wiskunde & Informatica (CWI) in Amsterdam and Google published the first practical SHA-1 collision. In December 2022, NIST announced that SHA-1 should be phased out by the end of 2030.
As of October 2026, NIST still lists SHA-256 as approved, and its hash-function page mentions no collision or preimage attack on the full function. That is a record to date, not a promise about the future.
November 12, 2026










