Skip to content

Feature Request: fund channel with all available funds, or a specific output #665

Closed

Description

@Sjors

Avoids the need for a change address, especially if you want to put all available funds in a single channel.

Activity

  1. added
    feature
    on Jan 19, 2018
  2. gdistasi commented on Jan 19, 2018

    @gdistasi

    I agree, this is a very useful feature.

  3. windsok commented on Jan 22, 2018

    @windsok
    Contributor

    Agree. I accidentally sent ~8000 satoshis to a change address when doing my first channel opening. My own fault, but an easier way to force spending all available funds and not producing a change UTXO would be useful.

  4. Sjors commented on Feb 24, 2018

    @Sjors
    ContributorAuthor

    With fees ticking up again, it's now spending ~€1.50 to open a channel, this becomes more relevant.

  5. added
    hx G4O
    on Mar 4, 2018
  6. cdecker commented on Mar 4, 2018

    @cdecker
    Member

    Marking as good first issue, shouldn't be too hard and it's a good exercise in getting acquainted with the source.

  7. ZmnSCPxj commented on Mar 4, 2018

    @ZmnSCPxj
    Contributor

    Suggestion for those who want to consider taking this issue: withdraw command supports all input to withdraw all funds; it may be useful to unify the code with withdraw, then support selecting an output by "txid:outnum" form in the unified code (to fund using a specific output). This implies adding a wrapper around wallet_select_coins/wallet_select_all.

  8. wythe commented on Mar 19, 2018

    @wythe
    Contributor

    I added support to fundchannel to accept "all". For now, I just made json_fund_channel look as close to a copy of json_withdraw as possible. Now, as @ZmnSCPxj suggests, I will unify the code and also support selecting a specific output.

    It worked on testnet for me, and I added a test_funding_all python test.

    Its all on my fund_all branch. Should I make a pull request and mark as work-in-progress?

  9. ZmnSCPxj commented on Mar 19, 2018

    @ZmnSCPxj
    Contributor

    Yes, please make pull request, thank you! It could be marked WIP if you intend to also add the specific-output support in the same pull request but we could also do a separate pull request for the specific-output support.

  10. wythe commented on Mar 19, 2018

    @wythe
    Contributor

    Ok sounds like a plan. Will do.

  11. robtex commented on Apr 22, 2018

    @robtex

    why limit ourselves to a 1) specific amount, 2) 'all', or 3) a specific manually selected utxo?
    i think fundchannel should take a range, like
    fundchannel X 10000-16000
    and the lightning deamon would find "hey i can use this old 12000 utxo to fund the channel"
    or "i can use my 7000+6000 utxo:s and make a 13000 channel"
    if it doesn't easily find any suitable utxo[s], go ahead and do it the old way.
    i mean, we are funding our own channel, not sending money to someone, thus it doesn't have to be exact. and i'd rather leave some satoshis extra in the channel, than getting it back in a silly exchange utxo.
    (disclaimer: i'm pretty sure i have suggested the same thing before, but i can't remember where, might have been lnd related. anyhows, sorry for repeating myself. i usually only do that until i get what i want)

  12. wythe commented on Apr 24, 2018

    @wythe
    Contributor

    I hear you @robtex. Maybe another option, closest fit:
    fundchannel fit 10000 16000

    I also am experimenting with providing a list of utxos instead of just a single one.

  13. cdecker commented on Apr 24, 2018

    @cdecker
    Member

    I'd rather not make this RPC call any more complex than necessary. We can always add a new RPC command, and then we can externalize the coinselection completely, i.e., pass in a list of outputs that should be selected for the funding, and a value, similar to createrawtransaction in bitcoind.

  14. wythe commented on Apr 25, 2018

    @wythe
    Contributor

    Yeah that makes sense. Should I even add support for specifying the single utxo?

  15. cdecker commented on Apr 27, 2018

    @cdecker
    Member

    Well, that'd be covered by the manualfundchannel case, wouldn't it?

  16. wythe commented on Apr 27, 2018

    @wythe
    Contributor

    Yes.

  17. jb55 commented on Jul 24, 2018

    @jb55
    Collaborator

    This is implemented now, can this be closed?

  18. Sjors commented on Jul 25, 2018

    @Sjors
    ContributorAuthor

    Ah, I totally missed that. This was added in #1399 even though the description says it wasn't? Nice!

    No new functionality, just a continuation of my work toward completing #665

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurehx G4Ojson-rpc

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions