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_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.
- channel_id (hash): The temporary
HOOK RETURN
- result (string) (always "continue"): Must be set to
continueto 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..."
}