[bitcoin-dev] BIP 155 (addrv2) update - spec and Bitcoin Core v0.21 implementation
john at johnnewbery.com
Thu Dec 10 09:47:54 UTC 2020
BIP 155 was proposed in Feb 2019 by Wladimir van der Laan as a way of
gossipping longer node addresses over the Bitcoin P2P network, primarily
to support torv3 and other networks.
In the time since that initial mailing list post, several changes have
been made to the proposal. Discussion has been held on the BIPs repo,
and (for implementation issues) the Bitcoin Core repo.
This email summarizes the changes. Readers should refer to BIP 155
for the full specification.
### Specification changes
1. The `time` field in the `addrv2` message is now stored as a fixed
length uint32 instead of a variable-length compact size.
2. The `addr` field may be up to a maximum of 512 bytes (4096 bits)
instead of 32 bytes (256 bits) for compatibility with future address
3. Clients now SHOULD gossip addresses for known networks (even if they
can't connect to those networks). They SHOULD NOT gossip addresses
for unknown networks. They SHOULD also ignore addresses for known
networks that are different from the address length for that network
specified in BIP 155.
4. New network IDs MUST be reserved in a BIP document.
5. Support for `addrv2` is not dependent on a p2p protocol version.
A new message type `sendaddrv2` is introduced to signal support
for addrv2. To signal support for addrv2, this message MUST be sent
after the initial version message is sent and before the verack
message is sent.
### Implementation detail
During testing of the Bitcoin Core implementation, it was found that
another Bitcoin implementation would disconnect from peers on receipt of
an unknown message. I believe that to be an incorrect interpretation
of the Bitcoin p2p protocol. The original v0.1 Satoshi client (and all
Bitcoin Core versions derived from it) have always explicitly ignored
unknown message types as a mechanism to extend the p2p protocol. This
property allows p2p implementions to permissionlessly deploy opt-in
extensions to the protocol.
As a pragmatic step to prevent those implementations from being
disconnected from v0.21 Bitcoin Core nodes, this initial version will
_only_ send sendaddrv2 messages to peers on p2p protocol version 70016
and higher. This behaviour may be reverted in future, at which point
Bitcoin Core would send sendaddrv2 messages to all peers during the
Thanks to everyone who has contributed to the addrv2
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the bitcoin-dev