Skip to content

Commit

Permalink
fixup! Explicitly allow funding_locked early, and support alias scids.
Browse files Browse the repository at this point in the history
  • Loading branch information
rustyrussell committed Sep 27, 2021
1 parent 4501eb3 commit 4783937
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 9 additions & 2 deletions 02-peer-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,12 @@ The sender:
- MUST NOT send `funding_locked` unless outpoint of given by `funding_txid` and
`funding_output_index` in the `funding_created` message pays exactly `funding_satoshis` to the scriptpubkey specified in [BOLT #3](03-transactions.md#funding-transaction-output).
- MUST set `next_per_commitment_point` to the per-commitment point to be used
for the following commitment transaction, derived as specified in
for commitment transaction #1, derived as specified in
[BOLT #3](03-transactions.md#per-commitment-secret-requirements).
- SHOULD set `short_channel_id` `alias`.
- if `option_scid_alias_only` was negotiated:
- MUST set `short_channel_id` `alias`.
- otherwise:
- SHOULD set `short_channel_id` `alias`.
- if it sets `alias`:
- if the `announce_channel` bit was set in both `open_channel` and `accept_channel`:
- SHOULD initially set `alias` to value not related to the real `short_channel_id`.
Expand All @@ -444,6 +447,8 @@ The sender:
- MUST set `alias` to a value not related to the real `short_channel_id`.
- MUST NOT send the same `alias` for multiple peers.
- MUST always recognize the `alias` as a `short_channel_id` for incoming HTLCs to this channel.
- if `option_scid_alias_only` was negotiated:
- MUST NOT allow incoming HTLCs to this channel using the real `short_channel_id`
- MAY send multiple `funding_locked` messages with different `alias` values.
- otherwise:
- MUST wait until the funding transaction has reached `minimum_depth` before sending this message.
Expand All @@ -457,6 +462,8 @@ A non-funding node (fundee):

The receiver:
- MAY use any of the `alias` it received, in BOLT 11 `r` fields.
- if `option_scid_alias_only` was negotiated:
- MUST NOT use the real `short_channel_id` in BOLT 11 `r` fields.

From the point of waiting for `funding_locked` onward, either node MAY
fail the channel if it does not receive a required response from the
Expand Down
2 changes: 2 additions & 0 deletions 09-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ The Context column decodes as follows:
| 20/21 | `option_anchor_outputs` | Anchor outputs | IN | `option_static_remotekey` | [BOLT #3](03-transactions.md) |
| 22/23 | `option_anchors_zero_fee_htlc_tx` | Anchor commitment type with zero fee HTLC transactions | IN | | [BOLT #3][bolt03-htlc-tx], [lightning-dev][ml-sighash-single-harmful]|
| 26/27 | `option_shutdown_anysegwit` | Future segwit versions allowed in `shutdown` | IN | | [BOLT #2][bolt02-shutdown] |
| 46/47 | `option_scid_alias_only`| Always use negotiated channel aliases for routing | IN | | [BOLT #2][bolt02-funding-locked] |

## Requirements

Expand Down Expand Up @@ -84,6 +85,7 @@ This work is licensed under a [Creative Commons Attribution 4.0 International Li
[bolt02-open]: 02-peer-protocol.md#the-open_channel-message
[bolt03-htlc-tx]: 03-transactions.md#htlc-timeout-and-htlc-success-transactions
[bolt02-shutdown]: 02-peer-protocol.md#closing-initiation-shutdown
[bolt02-funding-locked]: 02-peer-protocol.md#the-funding_locked-message
[bolt04]: 04-onion-routing.md
[bolt07-sync]: 07-routing-gossip.md#initial-sync
[bolt07-query]: 07-routing-gossip.md#query-messages
Expand Down

0 comments on commit 4783937

Please sign in to comment.