Block Chain - Hash Function

Hash Function is a cryptographic algorithm that converts input data of any size into a fixed-length output (hash value) in a deterministic and irreversible manner.

Core Explanation (Exam-Focused)

  1. Fixed-Length Output
    Produces a hash of constant size regardless of input length.

  2. Deterministic
    Same input always results in the same hash.

  3. One-Way Function
    Original data cannot be derived from the hash.

  4. Collision Resistance
    Extremely difficult for two different inputs to produce the same hash.

  5. Avalanche Effect
    Small input change results in a completely different hash.

  6. Fast Computation
    Hashes are generated quickly for efficiency.

Role in Blockchain

  • Links blocks using previous block hash

  • Ensures data integrity of transactions

  • Used in mining and proof mechanisms

  • Forms Merkle trees

Common Hash Functions

  • SHA-256 – Bitcoin

  • Keccak-256 – Ethereum

Importance

  • Prevents data tampering

  • Enables immutability

  • Secures blockchain structure

One-Line Definition (Exam Use)

A hash function is a cryptographic algorithm that transforms data into a fixed-length, irreversible hash used to ensure integrity and security in blockchain systems.