<p>While both of these disable transaction relay, they are conceptually used for different purposes:</p>
<p>Block-relay-only connections (see <a href="https://bitcoin.stackexchange.com/questions/112828/what-is-a-block-relay-only-connection-what-is-it-used-for">this post</a> for more details) are hard-to-detect connections with the goal of hardening the network against eclipse attacks. They have been introduced in v0.19.0.1 (2019) - since then, nodes will by default make two additional outgoing block-relay-only connections.</p>
<p>Blocksonly mode is an optional startup option (<code>-blocksonly</code>), introduced in v0.12.0 (2016) that has the goal of reducing the bandwidth of a node to a minimum by not participating in transaction relay.</p>
<p>There are various differences between these:</p>
<ul>
<li>-blocksonly is a global startup option (applying to all connections) that is either active or not, block-relay-only is connection-specific.</li>
<li>A node in -blocksonly mode participates in address relay, while a node will never send out addresses over block-relay-only connections and ignores incoming addresses.</li>
<li>A node in -blocksonly signals not to receive any transactions and will disconnect peers that don't comply, but it will make an exception for whitelisted peers. There is no such exception for block-relay-only connections.</li>
<li>A node in -blocksonly mode may in special cases send out own transactions to its peers (for example if submitted directly via RPC). A node will never send a transaction over a block-relay-only connection.</li>
<li>A node in -blocksonly mode still treats two of their outbound connections as block-relay-only (for which then the stricter block-relay-only rules take precedence).</li>
</ul>

CC BY-SA 4.0
2023-04-27T13:56:39.327Z
"Blocksonly mode ... has the goal of reducing the bandwidth of a node to a minimum" -- Another goal, I think, is to reduce the node's memory requirement (the default mempool size reduces from 300 MB to 5 MB, see https://github.com/bitcoin/bitcoin/pull/26471), although this can also be accomplished using the `-maxmempool` configuration setting.
Larry Ruane
CC BY-SA 4.0
2022-06-13T22:58:29.187Z
2022-06-13T22:58:29.187Z
Lightlike
<p>The terms blocksonly and block-relay-only that are used in Bitcoin Core are very similar. What is the difference between them?</p>

<network><terminology><peers><p2p>
What is the difference between blocksonly and block-relay-only in Bitcoin Core?
Lightlike
# What is the difference between blocksonly and block-relay-only in Bitcoin Core?

(Asked by: username_0 on 2022-06-13)

The terms blocksonly and block-relay-only that are used in Bitcoin Core are very similar. What is the difference between them?

**Tags:** network, terminology, peers, p2p


---

## 1 answers

### Answer by username_0 on 2022-06-13. Score: 8 | Accepted answer

While both of these disable transaction relay, they are conceptually used for different purposes:

Block-relay-only connections (see [this post](https://bitcoin.stackexchange.com/questions/112828/what-is-a-block-relay-only-connection-what-is-it-used-for) for more details) are hard-to-detect connections with the goal of hardening the network against eclipse attacks. They have been introduced in v0.19.0.1 (2019) - since then, nodes will by default make two additional outgoing block-relay-only connections.

Blocksonly mode is an optional startup option (`-blocksonly`), introduced in v0.12.0 (2016) that has the goal of reducing the bandwidth of a node to a minimum by not participating in transaction relay.

There are various differences between these:

* -blocksonly is a global startup option (applying to all connections) that is either active or not, block-relay-only is connection-specific.
* A node in -blocksonly mode participates in address relay, while a node will never send out addresses over block-relay-only connections and ignores incoming addresses.
* A node in -blocksonly signals not to receive any transactions and will disconnect peers that don't comply, but it will make an exception for whitelisted peers. There is no such exception for block-relay-only connections.
* A node in -blocksonly mode may in special cases send out own transactions to its peers (for example if submitted directly via RPC). A node will never send a transaction over a block-relay-only connection.
* A node in -blocksonly mode still treats two of their outbound connections as block-relay-only (for which then the stricter block-relay-only rules take precedence).

> **Comments:**
> **username_1**: "Blocksonly mode ... has the goal of reducing the bandwidth of a node to a minimum" -- Another goal, I think, is to reduce the node's memory requirement (the default mempool size reduces from 300 MB to 5 MB, see https://github.com/bitcoin/bitcoin/pull/26471), although this can also be accomplished using the `-maxmempool` configuration setting.  

---

