A SegWit block commits to its witness data through a commitment in an output script of its coinbase transaction; Bitcoin Core verifies it in CheckWitnessMalleation in src/validation.cpp and rejects a mismatching block with the reason "bad-witness-merkle-match".
Sources and checks
T1BIP 141, Segregated Witness (Consensus layer)BIP, supports part of it
of the coinbase transaction.
Specification, Commitment structure, read 2026-11-20
T1Bitcoin Core src/validation.cpp, CheckWitnessMalleationSource code, says this directly
static bool CheckWitnessMalleation(const CBlock& block, bool expect_witness_commitment, BlockValidationState& state)
CheckWitnessMalleation, read 2026-11-20
bitcoin/bitcoin at f498a5a671 contains this text in src/validation.cpp, and still does on the default branch.
Run it yourself
git clone https://github.com/bitcoin/bitcoin && git -C bitcoin show f498a5a6718d9157b6afb85412c3462439117702:src/validation.cpp | grep -nF '/*reject_reason=*/"bad-witness-merkle-match",'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-segwit