<p>It isnt clear what exactly you're asking, but wiki is pretty clear on the structure of the response to a getaddr message. </p>

<p><a href="https://en.bitcoin.it/wiki/Protocol_specification#getaddr" rel="nofollow">https://en.bitcoin.it/wiki/Protocol_specification#getaddr</a></p>

<pre><code>The response to receiving this message is to transmit one or more addr messages with one
or more peers from a database of known active peers.
</code></pre>

<p>So the payload of the response will be a bunch of addrs:</p>

<p><a href="https://en.bitcoin.it/wiki/Protocol_specification#addr" rel="nofollow">https://en.bitcoin.it/wiki/Protocol_specification#addr</a></p>

<pre><code>Provide information on known nodes of the network. Non-advertised nodes should be forgotten
after typically 3 hours

Payload:
Field Size  Description     Data type               Comments
1+          count           var_int                 Number of address entries (max: 1000)
30x?        addr_list       (uint32_t + net_addr)[] Address of other nodes on the network.
                                                    version &lt; 209 will only read the first
                                                    one. The uint32_t is a timestamp (see
                                                    note below).
Note: Starting version 31402, addresses are prefixed with a timestamp. If no timestamp is
present, the addresses should not be relayed to other peers, unless it is indeed confirmed
they are up. 
</code></pre>

<p>And it even provides sample data:</p>

<pre><code>Payload:
01                                              - 1 address in this message
Address:
E2 15 10 4D                                     - Mon Dec 20 21:50:10 EST 2010 (only when version is &gt;= 31402)
01 00 00 00 00 00 00 00                         - 1 (NODE_NETWORK service - see version message)
00 00 00 00 00 00 00 00 00 00 FF FF 0A 00 00 01 - IPv4: 10.0.0.1, IPv6: ::ffff:10.0.0.1 (IPv4-mapped IPv6 address)
20 8D                                           - port 8333
</code></pre>

CC BY-SA 3.0
2014-06-19T07:51:44.187Z
Yes I have understood what addr message is, but getaddr message consists of a message header with payload 0? Or it's payload has the network address structure because it needs to request addresses?
angel limneos
CC BY-SA 3.0
2014-06-19T11:08:36.570Z
As the wiki says for getaddr, the request has no payload: "No additional data is transmitted with this message."
Matt
CC BY-SA 3.0
2018-02-28T15:42:17.363Z
Is a response necessary if there are zero addresses to advertise?
Jus12
CC BY-SA 3.0
2014-06-19T00:25:15.623Z
2014-06-19T00:36:49.070Z
2014-06-19T00:36:49.070Z
Matt
<p>My question is if getaddr consists of message header and if it has some payload, possibly an addr_recv and addr_from like version message. Wiki is pretty basic on this spot.</p>

<message>
GetAddr message structure
angel limneos
# GetAddr message structure

(Asked by: username_0 on 2014-06-18)

My question is if getaddr consists of message header and if it has some payload, possibly an addr\_recv and addr\_from like version message. Wiki is pretty basic on this spot.

**Tags:** message


---

## 1 answers

### Answer by username_1 on 2014-06-19. Score: 2

It isnt clear what exactly you're asking, but wiki is pretty clear on the structure of the response to a getaddr message.

<https://en.bitcoin.it/wiki/Protocol_specification#getaddr>

```
The response to receiving this message is to transmit one or more addr messages with one
or more peers from a database of known active peers.

```

So the payload of the response will be a bunch of addrs:

<https://en.bitcoin.it/wiki/Protocol_specification#addr>

```
Provide information on known nodes of the network. Non-advertised nodes should be forgotten
after typically 3 hours

Payload:
Field Size  Description     Data type               Comments
1+          count           var_int                 Number of address entries (max: 1000)
30x?        addr_list       (uint32_t + net_addr)[] Address of other nodes on the network.
                                                    version < 209 will only read the first
                                                    one. The uint32_t is a timestamp (see
                                                    note below).
Note: Starting version 31402, addresses are prefixed with a timestamp. If no timestamp is
present, the addresses should not be relayed to other peers, unless it is indeed confirmed
they are up. 

```

And it even provides sample data:

```
Payload:
01                                              - 1 address in this message
Address:
E2 15 10 4D                                     - Mon Dec 20 21:50:10 EST 2010 (only when version is >= 31402)
01 00 00 00 00 00 00 00                         - 1 (NODE_NETWORK service - see version message)
00 00 00 00 00 00 00 00 00 00 FF FF 0A 00 00 01 - IPv4: 10.0.0.1, IPv6: ::ffff:10.0.0.1 (IPv4-mapped IPv6 address)
20 8D                                           - port 8333

```

> **Comments:**
> **username_0**: Yes I have understood what addr message is, but getaddr message consists of a message header with payload 0? Or it's payload has the network address structure because it needs to request addresses?  
> **username_1**: As the wiki says for getaddr, the request has no payload: "No additional data is transmitted with this message."  
> **username_2**: Is a response necessary if there are zero addresses to advertise?  

---

