Signing you in…

What is Hashing?

A cryptographic hash function is a deterministic algorithm h:{0,1}{0,1}nh:\{0,1\}^{*} \to \{0,1\}^{n} that maps an input of arbitrary length (a byte string) to a fixed-length output called a digest (hash value). Determinism means identical inputs produce identical digests. In blockchain protocols, digest values are treated as commitments: changing any protocol-relevant byte changes the digest.

Security properties used in practice

Cryptographic security is expressed in computational terms. Typical goals are: • Preimage resistance: given y, it is infeasible to find x such that h(x)=yh(x)=y. • Second-preimage resistance: given x, it is infeasible to find xxx' \neq x with h(x)=h(x)h(x')=h(x). • Collision resistance: it is infeasible to find any distinct x,xx,x' such that h(x)=h(x)h(x)=h(x'). Here, “infeasible” means no known practical algorithm can achieve the task within realistic resource limits.

Where hashing appears in a blockchain

1) Chain linkage: block headers include a field with the hash of the previous header. If any header byte changes, the new hash no longer matches, so tampering is detected by recomputation. 2) Transaction commitment: many transactions are summarized into a single Merkle root included in the header. A Merkle proof lets a light client verify that a transaction is included in the set committed by that root, without downloading the full block.

Digest construction (conceptual)
📥
Collect protocol data
header fields + tx set
🧩
Compute Merkle root
txs → root (commitment)
🔗
Link headers
prev hash field
🧾
Verify
recompute & compare
Hashing vs encryption
AspectHashingEncryption
Primary goalIntegrity / commitmentConfidentiality (plus integrity with AEAD)
ReversibilityDesigned to be one-wayReversible with the correct key
Key materialNot required for basic hashingRequired for symmetric; pk/sk for asymmetric
Key properties to remember
🧠
Deterministic
🧷
Collision resistance
🔍
Preimage resistance
📏
Fixed-length output
⚠️Do not treat “any hash” as equivalent: protocol byte-encoding rules and the exact hash algorithm determine digest values. Always use the standardized algorithm specified by the protocol and audited implementations.