<p>Since the introduction of BIP130 (&quot;sendheaders&quot;), a node can request that new block announcements are sent through a HEADERS message rather than through an INV. This avoids a roundtrip, in case the receiver first wants to verify the PoW of the header before downloading the actual block data.</p>

CC BY-SA 4.0
2023-12-17T15:22:34.700Z
2023-12-17T15:39:29.603Z
2023-12-17T15:39:29.603Z
Pieter Wuille
<p>As far as I know, when we receive a new transaction or block, we send an INV message to all peers to inform them about it. If the peers want that data, they send us a GETDATA message. In several places (in BIP152 for example) I read and saw (picture below taken from BIP 152) that notification can also be done by sending a HEADER message? However, bitcoin wiki and all other sites say that this message is <strong>a reply to a previously sent GETHEADERS message</strong>.</p>
<p><a href="https://en.bitcoin.it/wiki/Protocol_documentation#headers" rel="nofollow noreferrer">bitcoin.wiki</a>:</p>
<blockquote>
<p>The headers packet returns block headers in response to a getheaders
packet.</p>
</blockquote>
<p><a href="https://developer.bitcoin.org/reference/p2p_networking.html#headers" rel="nofollow noreferrer">bitcoindeveloper</a>:</p>
<blockquote>
<p>The “headers” message sends block headers to a node which previously
requested certain headers with a “getheaders” message. A headers
message can be empty.</p>
</blockquote>
<p>Can you explain to me whether the HEADER message is also used for notifying peers about new blocks, why and in which cases?</p>
<p><a href="https://i.sstatic.net/Qw22C.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Qw22C.png" alt="enter image description here" /></a></p>

<relay>
Is a header message used to notify peers of a new block?
Cosmos
# Is a header message used to notify peers of a new block?

(Asked by: username_0 on 2023-12-17)

As far as I know, when we receive a new transaction or block, we send an INV message to all peers to inform them about it. If the peers want that data, they send us a GETDATA message. In several places (in BIP152 for example) I read and saw (picture below taken from BIP 152) that notification can also be done by sending a HEADER message? However, bitcoin wiki and all other sites say that this message is **a reply to a previously sent GETHEADERS message**.

[bitcoin.wiki](https://en.bitcoin.it/wiki/Protocol_documentation#headers):

> The headers packet returns block headers in response to a getheaders
> packet.

[bitcoindeveloper](https://developer.bitcoin.org/reference/p2p_networking.html#headers):

> The “headers” message sends block headers to a node which previously
> requested certain headers with a “getheaders” message. A headers
> message can be empty.

Can you explain to me whether the HEADER message is also used for notifying peers about new blocks, why and in which cases?

[![enter image description here](https://i.sstatic.net/Qw22C.png)](https://i.sstatic.net/Qw22C.png)

**Tags:** relay


---

## 1 answers

### Answer by username_1 on 2023-12-17. Score: 1 | Accepted answer

Since the introduction of BIP130 ("sendheaders"), a node can request that new block announcements are sent through a HEADERS message rather than through an INV. This avoids a roundtrip, in case the receiver first wants to verify the PoW of the header before downloading the actual block data.


---

