Check an 80-byte Bitcoin block header against its displayed hash
A header exporter can produce correct bytes while a downstream checksum comparison fails because the displayed block identifier uses reversed digest byte order.
Hash the serialized bytes
Use the current tip of any local network for this reproducible check. Request the header as hex and pass it to Python 3. Decode the hex before hashing and reverse the final digest for display.
tip=$(bitcoin-cli getbestblockhash)
header=$(bitcoin-cli getblockheader "$tip" false)
python3 -c 'import hashlib,sys; b=bytes.fromhex(sys.argv[1]); d=hashlib.sha256(hashlib.sha256(b).digest()).digest(); print(len(b),d[::-1].hex())' "$header"
printf '%s\n' "$tip"
Interpret the comparison
The first output should show 80 and the same hash as the second line. A 160-byte input length is a clue that ASCII hex characters were hashed directly. A successful match verifies serialization and identifier handling for that header. It does not validate the transactions in the block or the accumulated proof of work of the chain.