0339 - Final - Standards - Feb. 3, 2020 (6 years, 5 months ago)
3
2020
BIP: 339
Layer: Peer Services
Title: WTXID-based transaction relay
Author: Suhas Daftuar <[email protected]>
Comments-Summary: No comments yet.
Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP 339
Status: Final
Type: Standards Track
Created: 2020-02-03
License: BSD-2-Clause
This BIP describes two changes to the p2p protocol to support transaction relay based on the BIP 141 wtxid of a transaction, rather than its txid.
Historically, the inv messages sent on the Bitcoin peer-to-peer network to announce transactions refer to transactions by their txid, which is a hash of the transaction that does not include the witness (see BIP 141). This has been the case even since Segregated Witness (BIP 141/143/144) has been adopted by the network.
Not committing to the witness in transaction announcements creates inefficiencies: because a transaction's witness can be malleated without altering the txid, a node in receipt of a witness transaction that the node does not accept will generally still download that same transaction when announced by other peers. This is because the alternative -- of not downloading a given txid after rejecting a transaction with that txid -- would allow a third party to interfere with transaction relay by malleating a transaction's witness and announcing the resulting invalid transaction to nodes, preventing relay of the valid version of the transaction as well.
We can eliminate this concern by using the wtxid in place of the txid when announcing and fetching transactions.
As wtxid-based transaction relay is only enabled between peers that both support it, older clients remain fully compatible and interoperable after this change.
https://github.com/bitcoin/bitcoin/pull/18044
This BIP is licensed under the 2-clause BSD license.