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", "")
addr_recv += struct.pack(">H", 8333)
addr_from = struct.pack("Q", 0)
addr_from += struct.pack(">16s", "")
addr_from += struct.pack(">H", 8333)

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

1 Answer 1


Answered in this comment:

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.