The #Bitcoin #Lightning Spec Part 2/8: Base Protocol
1 min readDec 4, 2016
This part of the spec is about 4 pages and covers the basic expectations: that we will have a framing mechanism (BOLT 8 specifies the standard one) over which to send messages.
Here are the highlights:
- Default port 9735 (the Unicode character for Lightning (☇) thanks to Anthony Towns)
- Big-endian (I was at IBM when we threw in the towel on the endian wars, but SHA2 and pubkeys are usually big-endian anyway).
- Two-byte type prefix, followed by data.
- “It’s OK to be odd”: odd packet types and odd feature bits you don’t understand are fine, even ones are an error. This lets us flag both backwards-compatible and backwards-incompatible changes in future.
- Overlength packets are fine; this allows future extensions easily.
- Most packets are prefixed by 8-byte channel-id, which allows multiplexing of multiple channels between peers if you want to.