You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: bip-0324.mediawiki
+21-10Lines changed: 21 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,7 @@
10
10
Type: Specification
11
11
Assigned: 2019-03-08
12
12
License: BSD-3-Clause
13
+
Version: 1.0.1
13
14
Replaces: 151
14
15
</pre>
15
16
@@ -530,7 +531,9 @@ v2 Bitcoin P2P transport layer packets use the encrypted message structure shown
530
531
531
532
If the first byte of <code>message_type</code> is <code>b'\x00'</code>, the following 12 bytes are interpreted as an ASCII message type (as in the v1 P2P protocol), trailing padded with <code>b'\x00'</code> as necessary. If the first byte of <code>message_type</code> is in the range ''1..255'', it is interpreted as a message type ID. This structure results in smaller messages than the v1 protocol, as most messages sent/received will have a message type ID. We recommend reserving 1-byte type IDs for message types that are sent more than once per direction per connection.<ref name="smaller_messages">'''How do the lengths between v1 and v2 compare?''' For messages that use the 1-byte short message type ID, v2 packets use 3 bytes less per message than v1.</ref><ref name"fixed_length_long_ids">'''Why not allow variable length long message type IDs?''' Allowing for variable length long IDs reduces the available 1-byte ID space by 12 (to encode the length itself) and incentivizes less descriptive message types. In addition, limiting message types to fixed lengths of 1 or 13 hampers traffic analysis.</ref>
532
533
533
-
The following table lists currently defined message type IDs:
534
+
The value of <code>message_length</code> is '''length''' minus the size of the <code>message_type</code>.
535
+
536
+
The following table lists currently defined message type IDs and the 12-byte ASCII message type (trimmed of trailing padding) that they are treated as equivalent to:
534
537
535
538
{| class="wikitable"
536
539
|-
@@ -541,35 +544,36 @@ The following table lists currently defined message type IDs:
When a message type has both a 1-byte encoding and a 13-byte encoding defined, peers that support receiving that message type should accept messages using either encoding (e.g., if the "getblocktxn" message type is supported, then both the 1-byte <code>b'\x0a'</code> encoding and the 13-byte <code>b'\x00getblocktxn\x00'</code> should be supported, and behavior should not depend on which of the two encodings is received).
571
575
572
-
Additional message types may be added separately after BIP finalization.
576
+
Additional message type IDs may be added separately after BIP finalization.
573
577
574
578
=== Signaling specification ===
575
579
==== Signaling v2 support ====
@@ -583,6 +587,13 @@ For development and testing purposes, we provide a collection of test vectors in
583
587
* [[bip-0324/xswiftec_inv_test_vectors.csv|XSwiftECInv vectors]] provide examples of ''(u, x)'' pairs, and the various ''t'' values that ''xswiftec_inv'' maps them to.
584
588
* [[bip-0324/packet_encoding_test_vectors.csv|Packet encoding vectors]] illustrate the lifecycle of the authenticated encryption scheme proposed in this document.
585
589
590
+
== Changelog ==
591
+
592
+
* 1.0.1 (2026-01-16)
593
+
* Specify equivalence of 1-byte and 13-byte `message_type`
0 commit comments