lightning-fundchannel_complete

lightning-fundchannel_complete -- Command for completing channel establishment

SYNOPSIS

fundchannel_complete id psbt

DESCRIPTION

fundchannel_complete is a lower level RPC command. It allows a user to complete an initiated channel establishment with a connected peer.

Note that the funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed, as the commitment transactions for this channel are not secured until this command successfully completes. Broadcasting transaction before can lead to unrecoverable loss of funds.

  • id (pubkey): Node id of the remote peer.
  • psbt (string): Transaction to use for funding (does not need to be signed but must be otherwise complete).

RETURN VALUE

On success, an object is returned, containing:

  • channel_id (hash): The channel_id of the resulting channel.
  • commitments_secured (boolean) (always true): Indication that channel is safe to use.

ERRORS

On error the returned object will contain code and message properties, with code being one of the following:

  • -32602: If the given parameters are wrong.
  • -1: Catchall nonspecific error.
  • 305: Peer is not connected.
  • 306: Unknown peer id.
  • 309: PSBT does not have a unique, correct output to fund the channel.

AUTHOR

Lisa Neigut <[email protected]> is mainly responsible.

SEE ALSO

lightning-connect(7), lightning-fundchannel(7), lightning-multifundchannel(7), lightning-fundchannel_start(7), lightning-fundchannel_cancel(7), lightning-openchannel_init(7), lightning-openchannel_update(7), lightning-openchannel_signed(7), lightning-openchannel_bump(7), lightning-openchannel_abort(7)

RESOURCES

Main web site: https://github.com/ElementsProject/lightning

EXAMPLES

Example 1:

Request:

lightning-cli fundchannel_complete "nodeid101010101010101010101010101010101010101010101010101010101010" "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000"
{
  "id": "example:fundchannel_complete#1",
  "method": "fundchannel_complete",
  "params": [
    "nodeid101010101010101010101010101010101010101010101010101010101010",
    "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000"
  ]
}

Response:

{
  "channel_id": "channelid0910109101091010910109101091010910109101091010910109101",
  "commitments_secured": true
}

Example 2:

Request:

lightning-cli fundchannel_complete -k "id"="nodeid101010101010101010101010101010101010101010101010101010101010" "psbt"="cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000"
{
  "id": "example:fundchannel_complete#2",
  "method": "fundchannel_complete",
  "params": {
    "id": "nodeid101010101010101010101010101010101010101010101010101010101010",
    "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000"
  }
}

Response:

{
  "channel_id": "channelid0910209102091020910209102091020910209102091020910209102",
  "commitments_secured": true
}

Core Lightning (previously c-lightning) is a lightweight, highly customizable and standard compliant implementation of the Lightning Network protocol.

© 2023 Core Lightning
All rights reserved.

Discussion Forum

The official Core Lightning forum is hosted at discuss.corelightning.org

BuildonL2 Community

The official BuildOnL2 community lives at community.corelightning.org. Join us and build the future of bitcoin on lightning.

Mailing List

For general discussions about CLN implementation, use [email protected]. For the Lightning Network, use [email protected]

Telegram

Community-driven telegram group where most of the node operators hang out. Go to https://t.me/lightningd to join.

Discord

Community-driven discord server where the devs flock together. Go to https://discord.gg/w27fMFESMN to join.

Internet Relay Chat

Don't hesitate to reach out to us on IRC at #lightning-dev @ libera.chat, #c-lightning @ libera.chat.