Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BIP155: clarify variable integer format and change time to fixed 32 bit #967

Merged
merged 2 commits into from
Oct 1, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions bip-0155.mediawiki
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ The <code>addrv2</code> message is defined as a message where <code>pchCommand =
It is serialized in the standard encoding for P2P messages.
Its format is similar to the current <code>addr</code> message format
<ref>[https://bitcoin.org/en/developer-reference#addr Bitcoin Developer Reference: addr message]</ref>, with the difference that the
fixed 16-byte IP address is replaced by a network ID and a variable-length address, and the time and services format has been changed to VARINT.
fixed 16-byte IP address is replaced by a network ID and a variable-length address, and the services format has been changed to [https://en.bitcoin.it/wiki/Protocol_documentation#Variable_length_integer CompactSize].

This means that the message contains a serialized <code>std::vector</code> of the following structure:

Expand All @@ -55,13 +55,13 @@ This means that the message contains a serialized <code>std::vector</code> of th
!Name
!Description
|-
| <code>VARINT</code> (unsigned)
| <code>uint32_t</code>
| <code>time</code>
| Time that this node was last seen as connected to the network. A time in Unix epoch time format, up to 64 bits wide.
| Time that this node was last seen as connected to the network. A time in Unix epoch time format.
|-
| <code>VARINT</code> (unsigned)
| <code>CompactSize</code>
| <code>services</code>
| Service bits. A 64-wide bit field.
| Service bits. A bit field that is 64 bits wide, encoded in [https://en.bitcoin.it/wiki/Protocol_documentation#Variable_length_integer CompactSize].
|-
| <code>uint8_t</code>
| <code>networkID</code>
Expand Down Expand Up @@ -142,9 +142,7 @@ The reference implementation is available at (to be done)

==Acknowledgements==

- Jonas Schnelli: change <code>services</code> field to VARINT, to make the message more compact in the likely case instead of always using 8 bytes.

- Luke-Jr: change <code>time</code> field to VARINT, for post-2038 compatibility.
- Jonas Schnelli: change <code>services</code> field to [https://en.bitcoin.it/wiki/Protocol_documentation#Variable_length_integer CompactSize], to make the message more compact in the likely case instead of always using 8 bytes.

- Gregory Maxwell: various suggestions regarding extensibility

Expand Down