1
0
Fork 0
mirror of https://github.com/lightning/bolts.git synced 2025-03-10 09:10:07 +01:00

Clarify temporary_channel_id's acceptable usages

This commit is contained in:
Matt Corallo 2018-10-29 10:43:43 -04:00 committed by Rusty Russell
parent 20524d4109
commit fa52e74eac

View file

@ -110,7 +110,7 @@ The existence of the `chain_hash` allows nodes to open channels
across many distinct blockchains as well as have channels within multiple
blockchains opened to the same peer (if it supports the target chains).
The `temporary_channel_id` is used to identify this channel until the
The `temporary_channel_id` is used to identify this channel on a per-peer basis until the
funding transaction is established, at which point it is replaced
by the `channel_id`, which is derived from the funding transaction.
@ -242,6 +242,18 @@ are above both `dust_limit_satoshis`.
Details for how to handle a channel failure can be found in [BOLT 5:Failing a Channel](05-onchain.md#failing-a-channel).
#### Practical Considerations for temporary_channel_id
Note that as duplicate `temporary_channel_id`s may exist from different
peers, APIs which reference channels by their channel id before the funding
transaction is created are inherently unsafe. The only protocol-provided
identifier for a channel before funding_created has been exchanged is the
(source_node_id, destination_node_id, temporary_channel_id) tuple. Note that
any such APIs which reference channels by their channel id before the funding
transaction is confirmed are also not persistent - until you know the script
pubkey corresponding to the funding txo nothing prevents duplicative channel
ids.
#### Future
It would be easy to have a local feature bit which indicated that a