Lnd: Feature request: Specify wallet address for funding channel

Created on 12 Dec 2017  路  9Comments  路  Source: lightningnetwork/lnd

Regarding OpenChannelRequest gRPC Request there is no option to specify wallet address to fund the open channel.

It could be defined with:

request = ln.OpenChannelRequest(
target_peer_id=,
node_pubkey=,
node_pubkey_string=,
local_funding_amount=,
push_sat=,
fund_addr=
)

When closing the channel, the output should also specify what wallet will be funded (CloseChannelRequest):

{
close_pending: < PendingUpdate >,
confirmation: < ConfirmationUpdate >,
chan_close: < ChannelCloseUpdate >,
fund_addr: < FundAddress >
}

Thank you very much.

P4 beginner channel closing channel management

Most helpful comment

@Roasbeef Looking at picking this up if that's cool.

All 9 comments

Specify the wallet address to fund? The funds when you create a channel are sent to 2-of-2 multi-sig output. The structure of that output depends on the keys of the peer you're opening the channel with.

Do you mean something more along the lines of coin selection of _which_ inputs to using when funding the channel?

Closing to a specified address is def possible, just a matter of threading through a new parameter during the channel closure procedure. However, there's an option in the spec to open a channel and only allow it to be closed to a particular address for security reasons. So this feature would need to be aware of channels that have a closed delivery loop.

Do you mean something more along the lines of coin selection of which inputs to using when funding the channel?

Yes, i want to build a 3rd party webservice for those who want to deposit bitcoins and manage channels remotely. Unless they have to deposit in one address, it would be preferable if there is coin selection bound by TOKEN_ID which I have definitely to manage by myself.

Another feature request that I think would make sense to tackle at the same time as this one: it would be nice to be able to set some flag to commit the entire balance from the selected input(s) - minus the fee - to the channel. This would return an error if the entire balance is greater than the max channel size. I'm thinking this would be a handy feature to avoid creating dust change outputs and to ensure certain inputs are put towards a channel in their entirety.

@Roasbeef Looking at picking this up if that's cool.

this sounds like another feature request i had in mind.
to select the appropriate input(s) i think the best solution is to have something like
openchannel $nodeid 10000+2000 which would mean to select an input having at least 10000 sat and max 12000 and use all of whatever appropriate input is found, without making any change
if no single input is found it can try combining two inputs, etc.
if it fails it just fallbacks to make a normal 10000 sat channel with a change address.

I've been pulled into another project and am not actively working on this at the moment. I'll update this again once I can come back to this if it's still open.

I'd like to give this a shot.

I'd like to tackle the ability to configure a delivery address to transfer funds to when the channel is closed cooperatively.

I suggest the other proposed enhancements for input control discussed above will be addressed in other issues.

On the cli side, add a 'delivery_address' cli option that reads something like: "(optional) address to deliver funds upon cooperative channel closing"

On the server side pass the additional parameter in the channel close request to the channel closer and use it instead of a new address generated by the wallet.

Closing to a specified addr is now supported, and users can simulate specifying custom inputs for a funding transaction by using the PSBT funding feature.

Was this page helpful?
0 / 5 - 0 ratings