lightningdevkit / lightning-liquidity

Other
27 stars 17 forks source link

LSPS2: Let user provide a user_channel_id in invoice_parameters_generated #70

Closed johncantrell97 closed 10 months ago

johncantrell97 commented 11 months ago

Currently this crate surfaces a user_channel_id to the user in OpenChannel event that they must use as the user_channel_id when they create the channel. Currently, we are passing the SCID as the user_channel_id. This is because there's no way for the crate to map the channel during ChannelReady event to the scid used.

Not only is it a bit strange for our crate to specify what an ldk user's user_channel_id must be but it makes it difficult for them to track a entire flow from buy request to payment forwarded.

I think a better API would be one where the end-user can provide a user_channel_id to invoice_parameters_generated and our crate will resurface that during OpenChannel and keep a mapping from the user_channel_id => scid so that when ChannelReady event comes it can figure out the scid that was used.