LIGHTNING-HOOK-OPENCHANNEL2_SIGN(7)

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

πŸ¦‹ NAME πŸ¦‹

okay so bestie, you're on the LIGHTNING-HOOK-OPENCHANNEL2_SIGN(7) page β€” that's the manual-name vibe folded right in. The actual main character is openchannel2_sign, aka the hook for signing the dual-funding PSBT. It's giving β€œsign my inputs so the channel can move along” energy. πŸ’…

✨ DESCRIPTION ✨

The openchannel2_sign hook is called after commitment transactions have been received during dual-funding channel establishment. Translation: the channel-opening plot is at the signing scene, and your plugin is on deck. 🎬

Your plugin is expected to sign any inputs it owns in the provided PSBT and return the updated PSBT. Yes, it owns them β€” if they’re yours, sign ’em. ✍️

If no inputs need to be signed, the original PSBT should be returned unchanged. No notes, no edits, just hand it back exactly as it came. 🫢

Once both sides have provided signatures, the funding transaction will be broadcast. Boom: transaction goes out into the world. πŸ”₯

See plugins/funder.c for an example of how to use this hook to sign a funding transaction. That's the reference bestie, go peek. πŸ‘€

πŸŽ€ HOOK PAYLOAD πŸŽ€

  • openchannel2_sign (object): the payload package, containing:
    • 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. Like, this is not a drill, it's literally the go-ahead. βœ…
  • psbt (string): the PSBT including any added signatures. If no inputs were signed, this should be identical to the input PSBT. If you didn't touch anything, it's the same one, no cap. πŸͺž

🌈 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..."
}

Byeee πŸ’–πŸ’œ β€” footer sign-off: Core Lightning v26.06.9 on the version/source tip, and LIGHTNING-HOOK-OPENCHANNEL2_SIGN(7) in the date spot; that's the whole tea, periodt. 🫢

πŸ“¦ where this page comes from