LIGHTNING-HOOK-OPENCHANNEL2_SIGN(7)
π¦ 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 temporarychannel_ididentifying 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
- nixpkgs unstable: clightning 26.06.9
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms