Bitcoin Core counts each block's work as 2 to the power 256 divided by (target plus 1), the expected number of hashes needed to meet that target, and sums these values along a chain into nChainWork, the chainwork figure that decides which chain is best.
Sources and checks
T1Bitcoin Core src/chain.cpp, GetBitsProofSource code, says this directly
// We need to compute 2**256 / (bnTarget+1), but we can't represent 2**256
GetBitsProof comment, read 2026-11-20
T1Bitcoin Core src/chain.h, CBlockIndex::nChainWorkSource code, says this directly
Total amount of work (expected number of hashes) in the chain up to and including this block
CBlockIndex, nChainWork member comment, read 2026-11-20
bitcoin/bitcoin at f498a5a671 contains this text in src/chain.cpp, and still does on the default branch.
Run it yourself
git clone https://github.com/bitcoin/bitcoin && git -C bitcoin show f498a5a6718d9157b6afb85412c3462439117702:src/chain.cpp | grep -nF 'return (~bnTarget / (bnTarget + 1)) + 1;'Checked at block 976,753, 20 Nov 2026, 16:42 UTC: quotes 2/2, code 1/1
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