[30.x] Backport #35878 and prep for v30.5

bitcoin/bitcoin: PR #36893

Backport verdict: Needs clarification

Fidelity could not be established from the available evidence.

Evidence:

Limitations:

Coverage details

Background

Ralph's summary of historical context for the behaviour affected by this change. The historical record reviewed here is incomplete.

Documented decisions

The follow-up discussion in #35920 supplies a concrete interoperability reason for retaining some of that tolerance: a participant reported that a Neutrino client announced transactions using InvTypeWitnessTx, and a later update stated that the proposal had been changed to allow witness-tx INVs for non-wtxidrelay peers.

This supports compatibility with deployed, nonconforming transaction broadcasters rather than treating MSG_WITNESS_TX INVs as protocol-valid. Importantly, the stated accommodation was limited to non-wtxidrelay peers; it does not document a reason to preserve the same tolerance on negotiated wtxidrelay connections.

Source 1 · Source 2 · Source 3

BIP 339 introduced MSG_WTX specifically to identify transactions by wtxid. Its motivation was that txids do not commit to witnesses: rejecting all future downloads of a txid after receiving an invalid witness would let an adversary suppress the valid transaction, while repeatedly downloading witness variants wastes resources. Negotiated wtxid relay addresses that tradeoff, and requires MSG_WTX announcements after receiving wtxidrelay.

This is the historical reason not to equate a txid-bearing announcement with a wtxid-bearing announcement merely because their 256-bit hash fields match. It also explains why acceptance of MSG_WITNESS_TX on a wtxidrelay connection should not be described as a requirement of BIP 339 compatibility.

Source 1