What Is the Hash Function Commonly Used in Bitcoin’s Proof-of-Work?
Bitcoin's Proof-of-Work (PoW) consensus mechanism uses the SHA-256 (Secure Hash Algorithm 256-bit) hash function. Specifically, it uses a double SHA-256, meaning the data is hashed twice: SHA256(SHA256(data)).
Miners repeatedly calculate this hash, adjusting a nonce, until the resulting hash is below a specific target difficulty. This double hashing is done to mitigate a potential length-extension attack, though SHA-256 itself is not vulnerable to it.