LIGHTNING-HOOK-OPENCHANNEL2_CHANGED(7)
πΈ NAME πΈ
openchannel2_changed β the hook for handling updates to the dual-funding PSBT. This is the LIGHTNING-HOOK-OPENCHANNEL2_CHANGED(7) manual page, bestie, and it is lowkey iconic. π
β¨ DESCRIPTION β¨
The openchannel2_changed hook gets called when the peer sends an updated PSBT during dual-funding channel negotiation. Periodt. It lets plugins inspect and modify the PSBT before it is sent back to the peer. Negotiation keeps going until neither side makes further changes to the PSBT β at that point, commitment transactions are exchanged. π
See plugins/funder.c for an example of how to use this hook to continue a v2 channel open. No cap, it's right there in the source.
π HOOK PAYLOAD π
openchannel2_changed(object): the payload object, main character energy only.channel_id(hash): the temporarychannel_ididentifying 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. Slay, you can touch it.require_confirmed_inputs(boolean): indicates whether the remote peer requires all inputs in the PSBT to be confirmed. Iftrue, the plugin must avoid adding unconfirmed inputs. (added v23.02)
π¨ Vibe check: whenrequire_confirmed_inputsistrue, do not add unconfirmed inputs. The remote peer is requiring all inputs in the PSBT to be confirmed, so respect that, bestie.
π¦ 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..."
}
Final cute sign-off: this page comes from Core Lightning v26.06.9 and its manual name is LIGHTNING-HOOK-OPENCHANNEL2_CHANGED(7). The original footer doesnβt print a date, so Iβm not inventing one β periodt, bye bestie! π«Άπ
π¦ 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