LIGHTNING-OPENCHANNEL_SIGNED(7)

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

πŸ’… NAME

openchannel_signed β€” the command that slaps the final seal on a channel open, bestie. It concludes it. Periodt.

✨ SYNOPSIS ✨

openchannel_signed channel_id signed_psbt

πŸŽ€ DESCRIPTION πŸŽ€

Okay so openchannel_signed is a low level RPC command that concludes a channel open with the specified peer. It runs on the v2 openchannel protocol, which is the whole reason interactive transaction construction is even possible β€” iconic behavior honestly.

You call this one after openchannel_update comes back with commitments_secured set to true. That's the green light, no cap.

And here's the moment: this command will broadcast the finalized funding transaction, if we receive valid signatures from the peer. If the signatures don't check out, no broadcast. Simple as that.

The arguments, spelled out:

  • channel_id (hash): the Id of the channel. yep that's it.
  • signed_psbt (string): the PSBT that came back from openchannel_update (the one where commitments_secured was true), with partial signatures or finalized witness stacks included for every input that we contributed to the PSBT.

πŸ¦‹ RETURN VALUE πŸ¦‹

On success, you get an object back containing:

  • channel_id (hash): the channel id of the channel.
  • tx (hex): the funding transaction.
  • txid (txid): the txid of the tx.

πŸ’€ ERRORS πŸ’€

On error, the returned object has code and message properties, and code will be one of these:

  • -32602: if the given parameters are wrong.
  • -1: catchall nonspecific error.
  • 303: funding transaction broadcast failed.
  • 305: peer is not connected.
  • 309: PSBT missing required fields.
  • 311: unknown channel id.
  • 312: channel in an invalid state

πŸ‘‘ AUTHOR πŸ‘‘

Lisa Neigut niftynei@gmail.com is mainly responsible. thank you lisa 🫢

🌈 SEE ALSO 🌈

lightning-openchannel_init(7), lightning-openchannel_update(7), lightning-openchannel_abort(7), lightning-openchannel_bump(7), lightning-fundchannel_start(7), lightning-fundchannel_complete(7), lightning-fundchannel(7), lightning-fundpsbt(7), lightning-utxopsbt(7), lightning-multifundchannel(7)

🌸 RESOURCES 🌸

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

πŸ“ EXAMPLES πŸ“

Example 1:

Request:

$ lightning-cli openchannel_signed -k "channel_id"="channelid0111200111200111200111200111200111200111200111200111200" "signed_psbt"="cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000"
{
  "id": "example:openchannel_signed#1",
  "method": "openchannel_signed",
  "params": {
    "channel_id": "channelid0111200111200111200111200111200111200111200111200111200",
    "signed_psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000"
  }
}

Response:

{
  "tx": "02000000000101sgpsbt1100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000",
  "txid": "txidocsigned1011000110001100011000110001100011000110001100011000",
  "channel_id": "channelid0111200111200111200111200111200111200111200111200111200"
}

Example 2:

Request:

$ lightning-cli openchannel_signed "b020c1c6818daf024954c9ee578caad058cbcae7dd75b2c4d38b8f6f81901ff5" "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000"
{
  "id": "example:openchannel_signed#2",
  "method": "openchannel_signed",
  "params": [
    "b020c1c6818daf024954c9ee578caad058cbcae7dd75b2c4d38b8f6f81901ff5",
    "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000"
  ]
}

Response:

{
  "tx": "02000000000101sgpsbt12000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000",
  "txid": "txidocsigned1012000120001200012000120001200012000120001200012000",
  "channel_id": "channelid0111200111200111200111200111200111200111200111200111200"
}

that's the whole thing bestie, go sign some channels πŸ’œ β€” written from Core Lightning v26.06.9, LIGHTNING-OPENCHANNEL_SIGNED(7), mwah 🧚

πŸ“¦ where this page comes from