breez / breez-sdk-greenlight

MIT License
241 stars 42 forks source link

Allow set close_to address #711

Closed roeierez closed 8 months ago

roeierez commented 9 months ago

This address is the channel closure address where the funds are swept to. GL supports this: https://github.com/Blockstream/greenlight/blob/6ab8f3205639ddf611f99e71691f7515fc0d24e6/libs/proto/greenlight.proto#L55C16-L55C24

JssDWt commented 9 months ago

I think the close_to address is only used on mutual close. It should still be useful to set, but just noting it's not a silver bullet for all your onchain funds.

dangeross commented 8 months ago

I think there are 3 ways in the SDK interface we could add this:

Any of these approaches would have to serialize a gl_config message and write it to the datastore.

As much as I would prefer not to add SDK methods, I think it puts less burden of the user/vendor to store a close_to_addr and use it in the config or pass each time to receive_payment / receive_onchain

roeierez commented 8 months ago

I agree adding a method seems like most fit here. Using the config is a problem since it can only be used when the sdk connects. Although perhaps we can mimic GL here and add a method setNodeConfig? Or you think it is going to be confusing with the current config? Just looking for a way not to add methods when gl adds more parameters to their node config.

dangeross commented 8 months ago

It might work set_node_config(NodeConfigRequest req). But maybe it might be confusing as there is already a NodeConfig for passing the node credentials.