LIGHTNING-FUNDCHANNEL_COMPLETE(7)

πŸ“¦
version 26.06.9 Β· 2 versions
, in nixpkgs unstable

πŸ’… LIGHTNING-FUNDCHANNEL_COMPLETE(7) ✨

okay so bestie, welcome to lightning-fundchannel_complete β€” it's a page from the Core Lightning manual, and it's literally the "finish the thing" button for channel establishment πŸŽ€


🌸 NAME 🌸

fundchannel_complete β€” the command for completing channel establishment. that's it, that's the vibe πŸ¦‹


✨ SYNOPSIS ✨

fundchannel_complete id psbt [withhold]

πŸ’– DESCRIPTION πŸ’–

okay so fundchannel_complete is a lower level RPC command, meaning it's giving main-character energy for people who already know what they're doing πŸ’… it lets a user complete an initiated channel establishment with a connected peer.

⚠️ no cap, this is the important part: the funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed, because the commitment transactions for this channel are not secured until this command successfully completes. broadcasting the transaction before that can lead to unrecoverable loss of funds 😭 like, actual money, gone, forever. please please please don't.

now the params, one by one, slay:

  • id (pubkey) β€” the node id of the remote peer 🫢
  • psbt (string) β€” the transaction to use for funding. it does not need to be signed, but it must be otherwise complete ✨
  • withhold (boolean, optional) β€” marks this channel 'withheld' so we know we haven't broadcast the funding transaction. if the channel is closed before we call sendpsbt on this psbt, it will simply be closed immediately πŸƒβ€β™€οΈπŸ’¨ (added in v25.12, iykyk)

πŸ”₯ RETURN VALUE πŸ”₯

on success, an object comes back at you, containing:

  • channel_id (hash) β€” the channel_id of the resulting channel πŸ‘‘
  • commitments_secured (boolean) (always true) β€” the indication that the channel is safe to use. yes bestie, safe 🫢

😭 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 niftynei@gmail.com is mainly responsible πŸ’– iconic behavior, honestly.


🌈 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" "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000"
{
  "id": "example:fundchannel_complete#1",
  "method": "fundchannel_complete",
  "params": [
    "nodeid101010101010101010101010101010101010101010101010101010101010",
    "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000"
  ]
}

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
}

okay that's the whole page bestie, every single flag and every single error code, nothing skipped, we ate and left no crumbs πŸ‘‘βœ¨ this one's from Core Lightning v26.06.9 β€” go forth and complete those channels responsibly, mwah πŸ’…πŸ’–πŸ¦‹

πŸ“¦ where this page comes from