A Bitcoin block's hash is the double SHA-256 (SHA-256 applied twice) of its serialized header: Bitcoin Core's CBlockHeader::GetHash writes the header into a HashWriter, whose GetHash computes double SHA-256.
Sources and checks
T1Bitcoin Core src/primitives/block.cpp, CBlockHeader::GetHashSource code, says this directly
return (HashWriter{} << *this).GetHash();
CBlockHeader::GetHash, read 2026-11-20
T1Bitcoin Core src/hash.h, HashWriter::GetHashSource code, says this directly
Compute the double-SHA256 hash of all data written to this object.
HashWriter::GetHash comment, read 2026-11-20
bitcoin/bitcoin at f498a5a671 contains this text in src/primitives/block.cpp.
Run it yourself
git clone https://github.com/bitcoin/bitcoin && git -C bitcoin show f498a5a6718d9157b6afb85412c3462439117702:src/primitives/block.cpp | grep -nF 'return (HashWriter{} << *this).GetHash();'bitcoin/bitcoin at f498a5a671 contains this text in src/hash.h.
Run it yourself
git clone https://github.com/bitcoin/bitcoin && git -C bitcoin show f498a5a6718d9157b6afb85412c3462439117702:src/hash.h | grep -nF 'Compute the double-SHA256 hash of all data written to this object.'Checked at block 976,753, 20 Nov 2026, 16:42 UTC: quotes 2/2, code 2/2
History
Nothing is edited silently; every revision keeps what it replaced.
- 20 Nov 2026, 16:42 UTCblock 976,753
Published Revision 1, run 2026-11-20-seed-proof-of-work