Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Request] sendcoins all / openchannel all #619

Closed
junderw opened this issue Jan 18, 2018 · 14 comments · Fixed by #6903
Closed

[Request] sendcoins all / openchannel all #619

junderw opened this issue Jan 18, 2018 · 14 comments · Fixed by #6903
Labels
beginner Issues suitable for new developers channels feature request Requests for new features fees Related to the fees paid for transactions (both LN and funding/commitment transactions) funding Related to the opening of new channels with funding transactions on the blockchain gRPC P3 might get fixed, nice to have rpc Related to the RPC interface
Milestone

Comments

@junderw
Copy link
Contributor

junderw commented Jan 18, 2018

Reason: Currently, if I want to spend 100% of my funds onchain OR spend 100% of my funds to a channel, I need to dance back and forth by overshooting it and seeing the error message telling me how much I need, subtract, then send the exact amount.

Flow

  • User specifies in the args that "I want to send as much as possible accounting for fees" ( ALL in place of the local_amt etc.)
  • lnd calculates the fees for the opening channel transaction normally, and subtracts that from available witness outputs (for openchannel) or all inputs (for sendcoins) and performs the send operation without interaction from the user.
@halseth halseth added rpc Related to the RPC interface gRPC funding Related to the opening of new channels with funding transactions on the blockchain channels feature request Requests for new features fees Related to the fees paid for transactions (both LN and funding/commitment transactions) labels Jan 19, 2018
@Roasbeef Roasbeef added the beginner Issues suitable for new developers label Feb 28, 2018
@t4sk
Copy link
Contributor

t4sk commented Mar 3, 2018

I will give it crack!

@githubsands
Copy link

@t4sk are you actively working on this?

@t4sk
Copy link
Contributor

t4sk commented Mar 9, 2018

@githubsands I am planning to work on it this weekend but I am also happy to hand it over to you :)

@Roasbeef
Copy link
Member

AFAIK, this issue is still up for grabs!

@simonhorlick
Copy link
Contributor

This would actually be super useful. I might pick it up if nobody else has raised a PR.

@simonhorlick
Copy link
Contributor

For the openchannel case I feel like the main issue here is that the user has to guess the fee. For example the following flow is frustrating:

$ lncli walletbalance
{
    "total_balance": "16768865",
    "confirmed_balance": "16768865",
    "unconfirmed_balance": "0"
}
$ lncli openchannel 03dfb7ad0bda82ecb7b516a57c914bbcb71a58cf4f70d22d313731b33a9a7de3d0 16768865
[lncli] rpc error: code = Unknown desc = not enough witness outputs to create funding transaction, need 0.16776515 BTC only have 0.16768865 BTC  available

We could take the fee from local_amt by default, but the change of behaviour might surprise users. We could also add a new option such as --include-fee that makes it explicit that the local_amt includes the fee.

Finally, do we want to commit 100% to channel balances, or should we reserve a certain amount in case fees increase later on? From BOLT2:

Given the variance in fees, and the fact that the transaction may be spent in the future, it's a good idea for the fee payer to keep a good margin (say 5x the expected fee requirement); but, due to differing methods of fee estimation, an exact value is not specified.

@dabura667
Copy link

a new option such as --include-fee

This should be sufficient.

do we want to commit 100% to channel balances

This could also be another arg.

So in summary:

  1. Add --include-fee arg to openchannel and sencoins.
  2. Add --ignore-fee-buffer for openchannel (assuming lnd is already calculating some buffer for fees that it is not allowing to be used for openchannel) to ignore the buffer and allow sending all funds to an openchannel.

@simonhorlick
Copy link
Contributor

simonhorlick commented Jun 18, 2018

I was confusing the fee for the funding tx and the commitment tx. In this issue I only really care about the funding tx.

@Talkless
Copy link

Talkless commented Dec 8, 2018

This feature is really needed, any progress?

@Roasbeef
Copy link
Member

Roasbeef commented Dec 9, 2018

See #2198

@Roasbeef
Copy link
Member

The ability to send all the coins out of the wallet has been merged. The follow up would be a similar command to take all those UTXOs and fund a channel.

@bjarnemagnussen
Copy link
Contributor

I will take a look and try to implement the functionality of this for opening channels.

@guggero
Copy link
Collaborator

guggero commented Sep 8, 2020

Will be fixed by #4029.

@guggero guggero linked a pull request Sep 8, 2020 that will close this issue
11 tasks
@saubyk saubyk added this to the v0.16.0 milestone Aug 19, 2022
@saubyk
Copy link
Collaborator

saubyk commented Sep 14, 2022

Will be fixed by #6903 owned by @hieblmi

@saubyk saubyk removed a link to a pull request Jan 25, 2023
11 tasks
@saubyk saubyk modified the milestones: v0.16.0, v0.16.1 Feb 14, 2023
@saubyk saubyk removed this from lnd v0.16.0 Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginner Issues suitable for new developers channels feature request Requests for new features fees Related to the fees paid for transactions (both LN and funding/commitment transactions) funding Related to the opening of new channels with funding transactions on the blockchain gRPC P3 might get fixed, nice to have rpc Related to the RPC interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.