Coin Brief ENDE

BIP 333 lets BIP324 peers pick their own one-byte IDs for frequently sent messages

The bitcoin/bips repository merged BIP 333 on 20 November, a draft by Anthony Towns titled BIP324 One-Byte Message Type ID Alias Assignment. It targets nodes using BIP324 encrypted transport, which can already replace the 12-byte ASCII name of a message type with a single byte, but only for entries in a fixed table. Adding to that table needs coordination across the whole network and risks conflicts. BIP 333 lets each node choose aliases for its own outgoing messages at runtime instead.

Support is announced with the feature message from BIP 434, sent between version and verack with the feature ID BIP333. A node may then send one set324alias message, after verack and preferably as soon as possible, listing pairs of a one-byte ID from 1 to 255 and the 12-byte message type it stands for; ID zero is not allowed because of how BIP324 encodes message types. The receiving peer keeps a separate mapping for each connection, applies the aliases in order and immediately, and must still accept messages that use the full 12-byte name.

Aliases work in one direction only: they apply to messages sent by the node that declared them, and a peer that wants the same savings sends its own set324alias. The rationale gives the arithmetic: defining an alias costs 13 bytes and each use saves 12, so aliases pay off only for messages sent more than once, and the draft recommends not aliasing one-off messages. Nodes may also advertise the feature on some connections only, for example to reveal less about which software they run. The reference implementation is still marked as to-do, pointing to a branch in Towns' repository.

BIP 333 lets BIP324 peers pick their own one-byte IDs for frequently sent messages
BIP 333 lets BIP324 peers pick their own one-byte IDs for frequently sent messages — Coin Brief

Why it matters

Message names are a small but constant overhead on every peer-to-peer message. Letting peers agree on short IDs per connection removes the need to coordinate a global table and leaves room to experiment with new message types without spending bandwidth on their names.