Under SegWit's weight formula, each byte of non-witness transaction data counts as 4 weight units and each byte of witness data counts as 1; Bitcoin Core names this factor of 4 WITNESS_SCALE_FACTOR.
Sources and checks
T1Bitcoin Core src/consensus/validation.h, GetTransactionWeightSource code, says this directly
These implement the weight = (stripped_size * 4) + witness_size formula,
Comment above GetTransactionWeight, read 2026-11-20
T1Bitcoin Core src/consensus/consensus.h, WITNESS_SCALE_FACTORSource code, says this directly
inline constexpr int WITNESS_SCALE_FACTOR = 4;
WITNESS_SCALE_FACTOR, read 2026-11-20
bitcoin/bitcoin at f498a5a671 contains this text in src/consensus/consensus.h, and still does on the default branch.
Run it yourself
git clone https://github.com/bitcoin/bitcoin && git -C bitcoin show f498a5a6718d9157b6afb85412c3462439117702:src/consensus/consensus.h | grep -nF 'inline constexpr int WITNESS_SCALE_FACTOR = 4;'bitcoin/bitcoin at f498a5a671 contains this text in src/consensus/validation.h.
Run it yourself
git clone https://github.com/bitcoin/bitcoin && git -C bitcoin show f498a5a6718d9157b6afb85412c3462439117702:src/consensus/validation.h | grep -nF 'weight = (stripped_size * 4) + witness_size formula'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-segwit