From 3c5aef89d66990b2e81c9bbaf1d53624c81cd6a5 Mon Sep 17 00:00:00 2001 From: Suhas Daftuar Date: Mon, 3 Feb 2020 15:25:27 -0500 Subject: [PATCH 1/2] Add BIP-wtxid-relay --- bip-wtxid-relay.mediawiki | 58 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 bip-wtxid-relay.mediawiki diff --git a/bip-wtxid-relay.mediawiki b/bip-wtxid-relay.mediawiki new file mode 100644 index 00000000..df667de1 --- /dev/null +++ b/bip-wtxid-relay.mediawiki @@ -0,0 +1,58 @@ +
+  BIP: ???
+  Layer: Peer Services
+  Title: WTXID-based transaction relay
+  Author: Suhas Daftuar 
+  Comments-Summary: No comments yet.
+  Comments-URI:
+  Status: Draft
+  Type: Standards Track
+  Created: 2020-02-03
+  License: BSD-2-Clause
+
+ +==Abstract== + +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. + +==Motivation== + +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. + +==Specification== + +# A new wtxidrelay message is added, which is defined as an empty message where pchCommand == "wtxidrelay". +# The protocol version of nodes implementing this BIP must be set to 70016 or higher. +# The wtxidrelay message must be sent in response to a VERSION message from a peer whose protocol version is >= 70016, and prior to sending a VERACK. +# A new inv type MSG_WTX (0x00000005) is added, for use in both INV messages and GETDATA requests, indicating that the hash being referenced is a transaction's wtxid. In the case of GETDATA requests, MSG_WTX implies that the transaction being requested should be serialized with witness as well, as described in BIP 144. +# After a node has sent and received a "wtxidrelay" message to/from a given peer, the node is required to use the MSG_WTX inv-type when announcing transactions to that peer, or requesting announced transactions from that peer. + +==Backward compatibility== + +As wtxid-based transaction relay is only enabled between peers that both support it, older clients remain fully compatible and interoperable after this change. + +==Implementation== + +https://github.com/bitcoin/bitcoin/pull/18044 + +==Copyright== + +This BIP is licensed under the 2-clause BSD license. From b8fefbf5761d5cef6aed3f8a9a315e68c7ee06f4 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Thu, 25 Jun 2020 05:19:50 +0000 Subject: [PATCH 2/2] Assign BIP 339: WTXID-based transaction relay --- README.mediawiki | 7 +++++++ bip-wtxid-relay.mediawiki => bip-0339.mediawiki | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) rename bip-wtxid-relay.mediawiki => bip-0339.mediawiki (97%) diff --git a/README.mediawiki b/README.mediawiki index f5d7632f..8f845dad 100644 --- a/README.mediawiki +++ b/README.mediawiki @@ -946,6 +946,13 @@ Those proposing changes should consider that ultimately consent may rest with th | Standard | Draft |- +| [[bip-0339.mediawiki|339]] +| Peer Services +| WTXID-based transaction relay +| Suhas Daftuar +| Standard +| Draft +|- | [[bip-0340.mediawiki|340]] | | Schnorr Signatures for secp256k1 diff --git a/bip-wtxid-relay.mediawiki b/bip-0339.mediawiki similarity index 97% rename from bip-wtxid-relay.mediawiki rename to bip-0339.mediawiki index df667de1..1b04d384 100644 --- a/bip-wtxid-relay.mediawiki +++ b/bip-0339.mediawiki @@ -1,10 +1,10 @@
-  BIP: ???
+  BIP: 339
   Layer: Peer Services
   Title: WTXID-based transaction relay
   Author: Suhas Daftuar 
   Comments-Summary: No comments yet.
-  Comments-URI:
+  Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0339
   Status: Draft
   Type: Standards Track
   Created: 2020-02-03