addr_recv addr_from in version Message

3

1

I need some clarification about the meaning of the addr_from and addr_recv fields in the Version Message.

addr_recv: The network address of the node receiving this message does this mean the public IP of the node I am sending to ?

addr_from:The network address of the node emitting this message does this mean my public(external) IP address or my local IP address ?

Thanks ..

Ashod Apakian

Posted 2014-08-05T14:56:11.777

Reputation: 141

Answers

3

So assuming node A sends a version message to node B then the two fields have the following meaning and value:

  • addr_recv: node A says "I believe you are reachable via this IP", hence its value is B's public IP address, the IP this message was originally sent to.
  • addr_from: node A says "I believe my external IP is this", hence this is what A believes its external IP to be (but may be different if A is behind a NAT and has not learned its true external address yet).

cdecker

Posted 2014-08-05T14:56:11.777

Reputation: 7 878

What happens if the information in these fields is incorrect or missing?Sergei Tikhomirov 2018-03-26T15:42:57.040

2Bitcoin 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.Pieter Wuille 2018-03-26T17:15:11.490