Skip to content

Commit 87ef5aa

Browse files
committed
BIP155: clarify that "services" uses CompactSize
The Bitcoin Core source code has `VARINT` type which is different than the "variable integer" format used all over the P2P protocol and also for the "services" field in this BIP. The latter is called `CompactSize` in some BIPs and also in the Bitcoin Core source code, thus use the word `CompactSize` to refer to it and link to its documentation.
1 parent 2c7630e commit 87ef5aa

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

bip-0155.mediawiki

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ The <code>addrv2</code> message is defined as a message where <code>pchCommand =
4646
It is serialized in the standard encoding for P2P messages.
4747
Its format is similar to the current <code>addr</code> message format
4848
<ref>[https://bitcoin.org/en/developer-reference#addr Bitcoin Developer Reference: addr message]</ref>, with the difference that the
49-
fixed 16-byte IP address is replaced by a network ID and a variable-length address, and the services format has been changed to VARINT.
49+
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].
5050

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

@@ -59,9 +59,9 @@ This means that the message contains a serialized <code>std::vector</code> of th
5959
| <code>time</code>
6060
| Time that this node was last seen as connected to the network. A time in Unix epoch time format.
6161
|-
62-
| <code>VARINT</code> (unsigned)
62+
| <code>CompactSize</code>
6363
| <code>services</code>
64-
| Service bits. A 64-wide bit field.
64+
| Service bits. A bit field that is 64 bits wide, encoded in [https://en.bitcoin.it/wiki/Protocol_documentation#Variable_length_integer CompactSize].
6565
|-
6666
| <code>uint8_t</code>
6767
| <code>networkID</code>
@@ -142,7 +142,7 @@ The reference implementation is available at (to be done)
142142

143143
==Acknowledgements==
144144

145-
- 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.
145+
- 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.
146146

147147
- Gregory Maxwell: various suggestions regarding extensibility
148148

0 commit comments

Comments
 (0)