|
| 1 | +<pre> |
| 2 | + BIP: 338 |
| 3 | + Layer: Peer Services |
| 4 | + Title: Disable transaction relay message |
| 5 | + Author: Suhas Daftuar < [email protected]> |
| 6 | + Comments-Summary: No comments yet. |
| 7 | + Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0338 |
| 8 | + Status: Draft |
| 9 | + Type: Standards Track |
| 10 | + Created: 2020-09-03 |
| 11 | + License: BSD-2-Clause |
| 12 | +</pre> |
| 13 | + |
| 14 | +==Abstract== |
| 15 | + |
| 16 | +This BIP describes a change to the p2p protocol to allow a node to tell a peer |
| 17 | +that a connection will not be used for transaction relay, to support |
| 18 | +block-relay-only connections that are currently in use on the network. |
| 19 | + |
| 20 | +==Motivation== |
| 21 | + |
| 22 | +This proposal is part of an effort to increase the number of inbound |
| 23 | +connections that a peer can service, by distinguishing peers which will not |
| 24 | +relay transactions from those that do. |
| 25 | + |
| 26 | +Since 2019, software has been deployed[1] which initiates |
| 27 | +connections on the Bitcoin network and sets the transaction relay field |
| 28 | +(introduced by BIP 37 and also defined in BIP 60) to false, to prevent |
| 29 | +transaction relay from occurring on the connection. Additionally, addr messages |
| 30 | +received from the peer are ignored by this software. |
| 31 | + |
| 32 | +The purpose of these connections is two-fold: by making additional |
| 33 | +low-bandwidth connections on which blocks can propagate, the robustness of a |
| 34 | +node to network partitioning attacks is strengthened. Additionally, by not |
| 35 | +relaying transactions and ignoring received addresses, the ability of an |
| 36 | +adversary to learn the complete network graph (or a subgraph) is reduced[2], |
| 37 | +which in turn increases the cost or difficulty to an attacker seeking to carry |
| 38 | +out a network partitioning attack (when compared with having such knowledge). |
| 39 | + |
| 40 | +The low-bandwidth / minimal-resource nature of these connections is currently |
| 41 | +known only by the initiator of the connection; this is because the transaction |
| 42 | +relay field in the version message is not a permanent setting for the lifetime |
| 43 | +of the connection. Consequently, a node receiving an inbound connection with |
| 44 | +transaction relay disabled cannot distinguish between a peer that will never |
| 45 | +enable transaction relay (as described in BIP 37) and one that will. Moreover, |
| 46 | +the node also cannot determine that the incoming connection will ignore relayed |
| 47 | +addresses; with that knowledge a node would likely choose other peers to |
| 48 | +receive announced addresses instead. |
| 49 | + |
| 50 | +This proposal adds a new, optional message that a node can send a peer when |
| 51 | +initiating a connection to that peer, to indicate that connection should not be |
| 52 | +used for transaction relay for the connection's lifetime. In addition, without |
| 53 | +a current mechanism to negotiate whether addresses should be relayed on a |
| 54 | +connection, this BIP suggests that address messages not be sent on links where |
| 55 | +transaction relay has been disabled. |
| 56 | + |
| 57 | +After this BIP is deployed, nodes could more easily implement inbound |
| 58 | +connection limiting that differentiates low-resource nodes (such as those |
| 59 | +sending disabletx) from full-relay peers, potentially allowing for an increase |
| 60 | +in the number of block-relay-only connections that can be made on the network. |
| 61 | + |
| 62 | +==Specification== |
| 63 | + |
| 64 | +# A new disabletx message is added, which is defined as an empty message with message type set to "disabletx". |
| 65 | +# The protocol version of nodes implementing this BIP must be set to 70017 or higher. |
| 66 | +# If a node sets the transaction relay field in the version message to a peer to false, then the disabletx message MAY also be sent in response to a version message from that peer if the peer's protocol version is >= 70017. If sent, the disabletx message MUST be sent prior to sending a verack. |
| 67 | +# A node that has sent or received a disabletx message to/from a peer MUST NOT send any of these messages to the peer: |
| 68 | +## inv messages for transactions |
| 69 | +## getdata messages for transactions |
| 70 | +## getdata messages for merkleblock (BIP 37) |
| 71 | +## filteradd/filterload/filterclear (BIP 37) |
| 72 | +## mempool (BIP 35) |
| 73 | +## tx message |
| 74 | +# It is RECOMMENDED that a node that has sent or received a disabletx message to/from a peer not send any of these messages to the peer: |
| 75 | +## addr/getaddr |
| 76 | +## addrv2 (BIP 155) |
| 77 | +# The behavior regarding sending or processing other message types is not specified by this BIP. |
| 78 | +# Nodes MAY decide to not remain connected to peers that send this message (for example, if trying to find a peer that will relay transactions). |
| 79 | +
|
| 80 | +==Compatibility== |
| 81 | + |
| 82 | +Nodes with protocol version >= 70017 that do not implement this BIP, and nodes |
| 83 | +with protocol version < 70017, will continue to remain compatible with |
| 84 | +implementing software: transactions would not be relayed to peers sending the |
| 85 | +disabletx message (provided that BIP 37 or BIP 60 has been implemented), and while |
| 86 | +periodic address relay may still take place, software implementing this BIP |
| 87 | +should not be disconnecting such peers solely for that reason. |
| 88 | + |
| 89 | +Disabling address relay is suggested but not required by this BIP, to allow for |
| 90 | +future protocol extensions that might specify more carefully how address relay |
| 91 | +is to be negotiated. This BIP's recommendations for software to not relay |
| 92 | +addresses is intended to be interpreted as guidance in the absence of any such |
| 93 | +future protocol extension, to accommodate existing software behavior. |
| 94 | + |
| 95 | +Note that all messages specified in BIP 152, including blocktxn and |
| 96 | +getblocktxn, are permitted between peers that have sent/received a disabletx |
| 97 | +message, subject to the feature negotiation of BIP 152. |
| 98 | + |
| 99 | +This proposal is compatible with, but independent of, BIP 37. |
| 100 | + |
| 101 | +==Implementation== |
| 102 | + |
| 103 | +https://github.com/bitcoin/bitcoin/pull/20726 |
| 104 | + |
| 105 | +==References== |
| 106 | + |
| 107 | +# Bitcoin Core has [https://github.com/bitcoin/bitcoin/pull/15759 implemented this functionality] since version 0.19.0.1, released in November 2019. |
| 108 | +# For example, see https://www.cs.umd.edu/projects/coinscope/coinscope.pdf and https://arxiv.org/pdf/1812.00942.pdf. |
| 109 | +
|
| 110 | +==Copyright== |
| 111 | + |
| 112 | +This BIP is licensed under the 2-clause BSD license. |
0 commit comments