Probably a simple question, but I believe it is important to state it clearly for the beginners like me out there.
What is the hash function used for the Bitcoin proof-of-work? What implementations are available? Any Java implementation?
Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It only takes a minute to sign up.
Sign up to join this communityProbably a simple question, but I believe it is important to state it clearly for the beginners like me out there.
What is the hash function used for the Bitcoin proof-of-work? What implementations are available? Any Java implementation?
Bitcoin uses SHA256d to hash block headers, which is sha256(sha256(x))
.
In anticipation of your next question, it uses a double hash to protect against length extension attacks (source).
From Bitcoin Wiki PoW and tangentially, HashCash:
SHA256(SHA256(Block_Header)) but you have to be careful about byte-order.
Specifically, it is SHA256d
Implementations are often standard libraries, like Python's hashlib
.