openchannel2_sign

openchannel2_sign -- Hook for signing the dual-funding PSBT

DESCRIPTION

The openchannel2_sign hook is called after commitment transactions have been received during dual-funding channel establishment.

The plugin is expected to sign any inputs it owns in the provided PSBT and return the updated PSBT.

If no inputs need to be signed, the original PSBT should be returned unchanged.

Once both sides have provided signatures, the funding transaction will be broadcast.

See plugins/funder.c for an example of how to use this hook to sign a funding transaction.

HOOK PAYLOAD

  • openchannel2_sign (object):
    • channel_id (hash): The temporary channel_id identifying the channel being negotiated.
    • psbt (string): The Partially Signed Bitcoin Transaction (PSBT) representing the funding transaction.
      The plugin should add signatures for any inputs it controls.

HOOK RETURN

  • result (string) (always "continue"): Must be set to continue to proceed with channel opening.
  • psbt (string): The PSBT including any added signatures.
    If no inputs were signed, this should be identical to the input PSBT.

EXAMPLES

Example 1:

Request:

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

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.