openchannel2_changed

openchannel2_changed -- Hook for handling updates to the dual-funding PSBT

DESCRIPTION

The openchannel2_changed hook is called when the peer sends an updated PSBT during dual-funding channel negotiation.

This allows plugins to inspect and modify the PSBT before it is sent back to the peer.

The negotiation continues until neither side makes further changes to the PSBT, at which point commitment transactions are exchanged.

See plugins/funder.c for an example of how to use this hook to continue a v2 channel open.

HOOK PAYLOAD

  • openchannel2_changed (object):
    • channel_id (hash): The temporary channel_id identifying the channel being negotiated.
    • psbt (string): The current Partially Signed Bitcoin Transaction (PSBT) representing the funding transaction.
      This PSBT includes contributions from both peers and may be modified.
    • require_confirmed_inputs (boolean): Indicates whether the remote peer requires all inputs in the PSBT to be confirmed.
      If true, the plugin must avoid adding unconfirmed inputs. (added v23.02)

HOOK RETURN

  • result (string) (always "continue"): Must be set to continue to proceed with the channel opening negotiation.
  • psbt (string): The updated PSBT to send back to the peer.
    If no modifications are made, this should be identical to the input PSBT.

EXAMPLES

Example 1:

Request:

lightning-cli openchannel2_changed -k "openchannel2_changed"='{"channel_id": "252d1b0a1e57895e841...", "psbt": "cHNidP8BADMCAAAAAQ+yBipSVZr...", "require_confirmed_inputs": true}'
{
  "id": "example:openchannel2_changed#1",
  "method": "openchannel2_changed",
  "params": {
    "openchannel2_changed": {
      "channel_id": "252d1b0a1e57895e841...",
      "psbt": "cHNidP8BADMCAAAAAQ+yBipSVZr...",
      "require_confirmed_inputs": true
    }
  }
}

Response:

{
  "result": "continue",
  "psbt": "cHNidP8BADMCAAAAAQ+yBipSVZr..."
}

Core Lightning is Blockstream's open-source implementation of the Lightning Network optimised for performance. It is highly customizable through modular expandability.

© 2026 Core Lightning, a Blockstream project.
All rights reserved.

X Twitter Logo Streamline Icon: https://streamlinehq.com

X

The official Core Lightning X(Twitter) handle to follow project updates and announcements.

Github Logo 2 Streamline Icon: https://streamlinehq.com

Github

Github repository for source code, issues, and contributions. Visit our project here to explore or contibute.

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/V6ay9yNhBQ to join.