LIGHTNING-OPENCHANNEL_UPDATE(7)

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

πŸ¦‹ NAME

okay so bestie, this whole page is lightning-openchannel_update β€” the manual is LIGHTNING-OPENCHANNEL_UPDATE(7) and it's literally the command to update a collab channel open πŸ’…

✨ SYNOPSIS

openchannel_update channel_id psbt

πŸŽ€ DESCRIPTION

openchannel_update is a low level RPC command that keeps an open channel going, and the channel it's working on is the one you point at with channel_id. You hand it an updated psbt, and literally any changes compared to the PSBT that was last returned β€” whether that came from openchannel_init or from a previous call to openchannel_update β€” get communicated to the peer 🫢

Timeline check, bestie: this must be called after openchannel_init and before openchannel_signed. No skipping ahead, ikyk.

You also have to keep calling it until commitments_secured comes back as true β€” at that point, you call openchannel_signed with a signed version of the PSBT that the last openchannel_update call returned. That's the whole loop, periodt πŸ”₯

  • channel_id (hash): the id of the channel, obviously πŸ’–
  • psbt (string): the updated PSBT that gets sent to the peer. Fun fact: it's totally fine if it's identical to the PSBT last returned by either openchannel_init or openchannel_update β€” no cap, that's allowed πŸ™ˆ

πŸ‘‘ RETURN VALUE

On success you get an object back, and it's giving:

  • channel_id (hash): the channel id of the channel πŸ’œ
  • channel_type (object): the channel_type as negotiated with the peer. (added v24.02)
    • bits (array of u32s): each bit that's set in this channel_type. (added v24.02)
      • (u32, optional): bit number.
    • names (array of strings): the feature name for each bit set in this channel_type. tiny heads-up: anchors_zero_fee_htlc_tx is a deprecated synonym for anchors, ngl. (added v24.02)
      • (string, optional) (one of "static_remotekey/even", "anchor_outputs/even", "anchors_zero_fee_htlc_tx/even", "anchors/even", "scid_alias/even", "zeroconf/even"): name of the feature bit.
  • psbt (string): the PSBT of the funding transaction ✨
  • commitments_secured (boolean): whether the psbt is complete. if true, sign the psbt and call openchannel_signed to complete the channel open β€” that's your cue, bestie πŸŽ€
  • funding_outnum (u32): the index of the funding output in the psbt.
  • close_to (hex, optional): the scriptpubkey we have to close to if we mutual close 🌸
  • requires_confirmed_inputs (boolean, optional): does the peer require confirmed inputs in the psbt?

If commitments_secured is true:

  • channel_id (hash): the derived channel id.
  • funding_outnum (u32): the index of the funding output for this channel in the funding transaction.
  • close_to (hex, optional): if a close_to address was provided to openchannel_init and the peer supports option_upfront_shutdownscript.

πŸ’€ ERRORS

On error, the object you get back has code and message properties, and code is one of these:

  • -32602: if the given parameters are wrong.
  • -1: catchall nonspecific error.
  • 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. iconic behavior, honestly πŸ‘‘

🫢 SEE ALSO

lightning-openchannel_init(7), lightning-openchannel_signed(7), lightning-openchannel_bump(7), lightning-openchannel_abort(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_update -k "channel_id"="channelid0111200111200111200111200111200111200111200111200111200" "psbt"="cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000"
{
  "id": "example:openchannel_update#1",
  "method": "openchannel_update",
  "params": {
    "channel_id": "channelid0111200111200111200111200111200111200111200111200111200",
    "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000"
  }
}

Response:

{
  "channel_id": "channelid0111200111200111200111200111200111200111200111200111200",
  "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000",
  "channel_type": {
    "bits": [
      12,
      22
    ],
    "names": [
      "static_remotekey/even",
      "anchors/even"
    ]
  },
  "commitments_secured": true,
  "funding_outnum": 1,
  "close_to": "51202321a432c9022a560c7dae78bdb72c605c373961edd29c42aa98c183782d052a"
}

Example 2

Request:

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

Response:

{
  "channel_id": "channelid0111200111200111200111200111200111200111200111200111200",
  "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000",
  "channel_type": {
    "bits": [
      12,
      22
    ],
    "names": [
      "static_remotekey/even",
      "anchors/even"
    ]
  },
  "commitments_secured": true,
  "funding_outnum": 1,
  "close_to": "51202321a432c9022a560c7dae78bdb72c605c373961edd29c42aa98c183782d052a"
}

and that's the whole page, bestie 🧚 this lil manual came to you from Core Lightning v26.06.9 β€” go secure those commitments, ily, mwah πŸ’–

πŸ“¦ where this page comes from