<div dir="ltr">Hi all,<div><br></div><div>I've been working on a proposal to add support for relaying transactions based on their wtxid, rather than just their txid.  The current draft is at <a href="https://github.com/sdaftuar/bips/blob/2020-02-wtxid-relay/bip-wtxid-relay.mediawiki" target="_blank">https://github.com/sdaftuar/bips/blob/2020-02-wtxid-relay/bip-wtxid-relay.mediawiki</a>, and for some background I'll paste the motivation section here:</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">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.<br></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">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.<br></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">We can eliminate this concern by using the wtxid in place of the txid when announcing and fetching transactions.<br></blockquote><div><br></div><div>One point specifically that I'm seeking feedback on is feature negotiation: for efficiency, I think it makes sense for peers to negotiate at the beginning of a connection whether they are going to use wtxid- or txid-based, prior to announcing any transactions.  To achieve this, I propose in the BIP to send a message between receiving a VERSION message and prior to sending VERACK (to nodes advertising version at least 70016) to announce support for this new feature; if both sides send it then they each know to enable it on the link.  My thinking is that in general, it'd be great to use messages sent between VERSION and VERACK to negotiate features prior to fully initializing a peer connection (it's sort of a natural way to extend what we might want to send in a VERSION message, without breaking existing VERSION-message parsers).  However, I don't know whether inserting a message before VERACK would break any assumptions of other software on the network, or if this is a problematic paradigm for some reason, so I'd welcome feedback here.</div><div><br></div><div>Thanks,</div><div>Suhas</div></div>