Cryptographic Hash Functions in Blockchains: SHA-256, Keccak-256, and Preimage Resistance
A developer's guide to one-way mathematical hash functions, collision resistance, and how addresses are generated from public keys.
Deep dive into deterministic hash algorithms that power proof-of-work, address checksums, and block headers.
1. The Four Essential Cryptographic Properties
A cryptographic hash function maps arbitrary input data to a fixed-size byte string. To be secure for blockchains, it must be deterministic, quick to compute, pre-image resistant, and collision resistant.
Bitcoin utilizes double SHA-256 (SHA-256 applied twice). Ethereum utilizes Keccak-256 (the original proposal that became SHA-3 with subtle padding differences).
Interactive Tools Related to this Article
Secure your crypto offline with Trezor Safe 5
Full open-source firmware, secure element protection, and intuitive touchscreen control. Never store your seed phrase on a phone or laptop.
Affiliate partner: BlockToolsHub may earn a small referral commission at no additional cost to you.