Hashing

Hashing is the process of turning any data into a fixed-length code, called a hash, with a one-way function that cannot be reversed. Blockchains such as Bitcoin use hashing to link blocks, which makes confirmed transactions very hard to alter. The same input always gives the same hash, and a tiny change gives a completely different one.

How does hashing work?

A hash function turns any input into a fixed-length hash. SHA-256, used by Bitcoin, always returns 64 characters. Cryptographic hash functions have four properties:

  • Deterministic: the same input always gives the same hash.
  • Pre-image resistant: the hash does not reveal the input.
  • Collision resistant: two inputs with the same hash are practically impossible to find.
  • Avalanche effect: a tiny change to the input gives a completely different hash.

What does a hash look like?

Two words one capital letter apart give unrelated SHA-256 hashes (shown in groups of 16 characters):

  • coinmama: e925a5cad98a3533 3dcb4b8970c953ea 47acd0d2b9f9e4df 7397aad622994f5e
  • Coinmama: e044e8a148719226 f7608fe1b4c30970 b4de7f699f4fddee 10d4bf34d23375a9

How do blockchains use hashing?

Each block stores the previous block’s hash, chaining them into a blockchain. Hashing also turns transactions into TXIDs, secures proof of work mining (speed = hash rate, run on ASIC hardware), and turns a public key into a wallet address.

Why does hashing matter when you buy crypto?

A confirmed transaction cannot be quietly edited. Changing a block would break the hash link to every later block, forcing an attacker to redo all that later mining work. Read whether blockchain transactions can be reversed, or see the Bitcoin price and payment options.

How is hashing different from encryption?

Encryption can be undone with the right key. Hashing uses no key and cannot be undone.

FeatureHashingEncryption
Can it be reversed?No, it is one-wayYes, with the right key
Does it use a key?NoYes
Main purposeChecking that data has not changedKeeping data secret
Last checked: September 2026. Sources are listed below.

What are the risks and red flags?

Hashing protects the record, not you.

  • It does not guard your coins. Anyone with your private keys can move them, so learn to spot phishing attacks.
  • Sent is final. A payment to a wrong address usually cannot be undone, so check the address before you send.

Go deeper: What is proof of work? explains how mining uses hashing to secure a blockchain.

Go deeper

Sources

  1. NIST Computer Security Resource Center: Hash Functions (fixed-length digest, collision and preimage resistance) (accessed )
  2. NIST Computer Security Resource Center Glossary: Encryption (uses a key; decryption reverses it) (accessed )
  3. Bitcoin Developer Guide: Block Chain (blocks chained by the previous block's hash; proof of work) (accessed )