rgb-cln/openingd
Rusty Russell 94a7b4017e openingd: work harder to intuit OPT_SCID_ALIAS.
option_scid_alias inside a channel_type allows for more private
channels: in particular, it tells the peer that it MUST NOT allow
routing via the real short channel id, and MUST use the alias.

It only makes sense (and is only permitted!) on unannounced channels.

Unfortunately, we didn't set this bit in the channel_type in v12.0
when it was introduced, instead relying on the presence of the feature
bit with the peer.  This was fixed in 23.05, but:

1. Prior to 23.05 we didn't allow it to be set at all, and
2. LND has a limited set of features they allow, and this isn't allowed without
   option_anchors_zero_fee_htlc_tx.

We could simply drop this channel_type until we merge anchors, *but*
that has nasty privacy implications (you can probe the real channel id).

So, if we don't negotiate anchors (we don't!), we don't set this
channel_type bit even if we want it, and *intuit* it, based on:

1. Is this a non-anchor channel_type?
2. Did we both send channel_type?
3. Is this an unannounced channel?
4. Did both peers announce support for scid aliases?

In addition, while looking at the previous backwards-compat code, I
realized that v23.05 violated the spec and send accept_channel with
OPT_SCID_ALIAS if it intuited it, even if it wasn't offered.  Stop
doing this, but allow our peers to.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Fixed: Fix incompatibility with LND which prevented us opening private channels
Fixes: #6208
2023-06-06 12:01:36 +09:30
..
Makefile tx_roles: allow to be serialized btw processes 2023-02-07 21:03:36 -06:00
common.c opening: helper for anchor flagged, use in dualopend also 2023-02-04 15:31:16 +10:30
common.h opening: helper for anchor flagged, use in dualopend also 2023-02-04 15:31:16 +10:30
dualopend.c zeroconf: don't accept channel_type with option_zeroconf unless we're really zeroconf. 2023-04-10 17:26:47 +09:30
dualopend_wire.csv df: persist our setting to disk, read back to dualopend at reinit 2023-02-07 21:03:36 -06:00
openingd.c openingd: work harder to intuit OPT_SCID_ALIAS. 2023-06-06 12:01:36 +09:30
openingd_wire.csv openingd: work harder to intuit OPT_SCID_ALIAS. 2023-06-06 12:01:36 +09:30