[Lightning-dev] [PROPOSAL] Gossip protocol v2
rusty at rustcorp.com.au
Sun Jul 14 01:38:06 UTC 2019
At the last Summit we discussed using Schnorr sigs for gossip;
we'll also need to change things for taproot-based channels, so I think
it makes sense to combine the two changes.
channel_announcement drops from 430 to 140 (plus feature bitmap).
channel_update drops from to 136 to ~100 (assuming min & max specified)
node_announcement drops from 140 to >= 101 (plus alias, color, addresses).
Here's a rough draft based on what I think we've learned from current
1. Optional fields are move into TLVs.
2. chain_id is moved into a TLV, with bitcoin mainnet being default.
3. Timestamp should be a block number.
This final rule gives natural ratelimiting: you can only add one update
per block. SHOULD not use a block number from the last 60 seconds,
SHOULD use previous block number to allow for emergency updates, SHOULD
make bottom bit different from the previous update.
This plays much better with minisketch encoding, since even if we reduce
timestamp to 1 bit, propagation will Mostly Work.
Finally, it provides an implicit timestamp to channel_announcement,
which avoids the current dance we have to do (for the purposes of
timestamp filtering, the timestamp for channel_announcement is taken
from a channel_update).
1. type: 267 (`channel_announcementv2`)
- Where musig_combo_signature is the signature of the rest of the
message using the node_ids and the bitcoin key.
- The bitcoin key can be read directly from the outpoint referred to
- One tlv record will be chain_id, the default being bitcoin mainnet.
- Another will be for feature bits.
- The timestamp is implicitly the block number + 6, see below.
1. type: 269 (`node_announcementv2`)
- timestamp is simply a block number.
- tlvs contain optional alias, color.
- separate (odd) tlv types for each of IPv4/v6/Tor2/Tor3, length shows
if it encodes multiple addresses.
1. type: 271 (`channel_updatev2`)
- timestamp is a block number.
- channel_flags is direction and disable, as now.
- tlvs contains optional htlc_min_msat, htlc_max_msat, chain_hash (if
not bitcoin mainnet).
More information about the Lightning-dev