bip324: small improvements #1496

pull sipa wants to merge 3 commits into bitcoin:master from sipa:bip324 changing 1 files +12 −11
  1. sipa commented at 1:20 pm on September 15, 2023: member

    Contains 3 small improvements to BIP324:

    • Since (in the V1 protocol) message type strings must be followed by only 0 bytes after the first 0, the first 16 bytes of an incoming V1 connection are predictable (network magic + “version\x00\x00\x00\x00\x00”). The current BIP text states to only compare the first 12 bytes instead of 16. This is in theory a semantics change, but wouldn’t be observable except with negligible probability (v2 nodes that use 12 vs 16 can communicate with each other, and each can communicate with v1). However, there are possible future extensions that could make this observable (specifically, see footnote 19), so it seems worthwhile to still switch to 16.
    • Related to the previous point, it is also possible to detect incoming v1 connections of the wrong network: if the network magic does not match, but the version message type string after it does. Without this, an incoming connection from a v1 peer will get sent key + garbage, which in turn will almost certainly cause them to disconnect immediately, and changing this should not make much of a difference, but it allows for faster disconnect in this situation.
    • Drop the BIP330 message types from the short encodings list in the BIP. It feels like it shouldn’t be BIP324’s goal to predict future protocol improvements.
  2. Use 16-byte prefix to distinguish v1 from v2 175c5c06e0
  3. Allow detecting/disconnecting wrong-network v1 peers 397016ebdf
  4. For now, remove BIP330 messages before being adopted cdcb6801a1
  5. dhruv commented at 11:44 am on September 20, 2023: contributor
    ACK cdcb6801a1774616ddff6f8fa0d95c3367a66a32
  6. kallewoof merged this on Sep 21, 2023
  7. kallewoof closed this on Sep 21, 2023


sipa dhruv


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bips. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-10-31 23:10 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me