<p>Answered in <a href="https://bitcoin.stackexchange.com/questions/29872/addr-recv-addr-from-in-version-message/29876#comment84453_29876">this comment</a>:</p>

<blockquote>
  <p>Bitcoin Core actually ignores <code>addr_from</code> in received version
  messages. <code>addr_recv</code> is used to influence the heuristic that
  determines which of the receiving node's IP addresses is publicly
  reachable.</p>
</blockquote>

CC BY-SA 3.0
2018-04-04T16:33:39.393Z
2018-04-04T16:33:39.393Z
Sergei Tikhomirov
<p>I understand from <a href="https://bitcoin.stackexchange.com/a/29876/31712">this answer</a> the semantics of <code>addr_from</code> and <code>addr_recv</code>. It is not clear to me though what is their purpose. Don't we assume that the transport layer protocol takes care of, well, transport?</p>

<p>What happens if I send a version message where the information <code>addr_from</code> or <code>addr_recv</code> is missing or incorrect? E.g., in <a href="https://bitcoin.stackexchange.com/a/50502/31712">this answer</a> the example code includes the following:</p>

<pre><code>addr_recv = struct.pack("Q", 0)
addr_recv += struct.pack("&gt;16s", "127.0.0.1")
addr_recv += struct.pack("&gt;H", 8333)
addr_from = struct.pack("Q", 0)
addr_from += struct.pack("&gt;16s", "127.0.0.1")
addr_from += struct.pack("&gt;H", 8333)
</code></pre>

<p>If that works, why include anything meaningful in those fields?</p>

<protocol><network>
What is the purpose of addr_from and addr_recv in version message?
Sergei Tikhomirov
# What is the purpose of addr_from and addr_recv in version message?

(Asked by: username_0 on 2018-03-26)

I understand from this answer the semantics of addr_from and addr_recv. It is not clear to me though what is their purpose. Don't we assume that the transport layer protocol takes care of, well, transport?
What happens if I send a version message where the information addr_from or addr_recv is missing or incorrect? E.g., in this answer the example code includes the following:
addr_recv = struct.pack("Q", 0)
addr_recv += struct.pack(">16s", "127.0.0.1")
addr_recv += struct.pack(">H", 8333)
addr_from = struct.pack("Q", 0)
addr_from += struct.pack(">16s", "127.0.0.1")
addr_from += struct.pack(">H", 8333)

If that works, why include anything meaningful in those fields?

**Tags:** protocol, network


---

## 1 answers

### Answer by username_0 on 2018-04-04. Score: 2 | Accepted answer

Answered in [this comment](https://bitcoin.stackexchange.com/questions/29872/addr-recv-addr-from-in-version-message/29876#comment84453_29876):

> Bitcoin Core actually ignores `addr_from` in received version
> messages. `addr_recv` is used to influence the heuristic that
> determines which of the receiving node's IP addresses is publicly
> reachable.


---

