LIGHTNING-OPENCHANNEL_INIT(7)
๐ lightning-openchannel_init(7) โ the glam little manual page
okay so bestie, welcome to lightning-openchannel_init(7) โ literally the manual page where we learn how to slide into a peer's DMs and start a channel together. lowkey iconic. pull up a chair ๐
โจ NAME โจ
openchannel_init โ the command that kicks off a channel open to a peer. it's giving "first message, first impression" ๐
โจ SYNOPSIS โจ
openchannel_init id amount initialpsbt [commitment_feerate]
[funding_feerate] [announce] [close_to] [request_amt] [compact_lease]
[channel_type]
โจ DESCRIPTION โจ
openchannel_init is a low level RPC command that initiates a channel open with a specified peer. it runs on the openchannel protocol, which is the whole reason we get to do interactive transaction construction like the main characters we are ๐ no cap.
here's the cast of characters, aka every arg:
id(pubkey) โ the node id of the remote peer. yep, that's your person ๐ซถamount(sat) โ the satoshi value we are contributing to the channel. this value gets added to the provided PSBT in the output that's encumbered by the 2-of-2 script for this channel. write that down.initialpsbt(string) โ a funded but incomplete PSBT that specifies the UTXOs and change output for our channel contribution. it can be updated later, seeopenchannel_update.initialpsbtmust have at least one input. also it must have the Non-Witness UTXO (PSBT_IN_NON_WITNESS_UTXO) set for every input โ if you don't, you get an error with code 309 returned. no vibes-based PSBTs allowed ๐commitment_feerate(feerate, optional) โ the feerate for commitment transactions, but for non-anchor channels: seefundchannel. for anchor channels, bestie, it's literally ignored.funding_feerate(feerate, optional) โ the feerate for the funding transaction. default is the'opening'feerate โจannounce(boolean, optional) โ whether or not to announce this channel. your call, queen.close_to(string, optional) โ a Bitcoin address where the channel funds should be sent on close. only valid if both peers have negotiatedoption_upfront_shutdown_scriptโ it takes two, periodt ๐คrequest_amt(sat, optional) โ an amount of liquidity you'd like to lease from the peer. if the peer supportsoption_will_fund, this tells them to include this much liquidity into the channel. you must also pass incompact_leasealongside it.compact_lease(hex, optional) โ a compact representation of the peer's expected channel lease terms. if the peer's terms don't match this set, we will fail to open the channel ๐ญchannel_type(array of u32s, optional) โ each bit set in thischannel_type.:- (u32, optional) โ bit number.
๐ธ RETURN VALUE ๐ธ
on success you get an object back, and it contains:
channel_id(hash) โ the channel id of the channel ๐psbt(string) โ the (incomplete) PSBT of the funding transaction.channel_type(object) โ the channel_type as negotiated with peer. (added v24.02):bits(array of u32s) โ each bit set in thischannel_type. (added v24.02):- (u32, optional) โ bit number.
names(array of strings) โ the feature name for each bit set in thischannel_type. note thatanchors_zero_fee_htlc_txis a deprecated synonym foranchors. (added v24.02):- (string, optional) (one of
"static_remotekey/even","anchor_outputs/even","anchors_zero_fee_htlc_tx/even","anchors/even","scid_alias/even","zeroconf/even") โ name of feature bit.
commitments_secured(boolean) (always false) โ whether the psbt is complete. it's always false, bestie, that's just the law โ๏ธfunding_serial(u64) โ the serial_id of the funding output in the psbt.requires_confirmed_inputs(boolean, optional) โ does peer require confirmed inputs in psbt?
if the peer does not support option_dual_fund, this command returns an error. sorry babe ๐
and if you sent a request_amt and the peer supports option_will_fund and is interested in leasing you liquidity in this channel, it returns their updated channel fee max (channel_fee_proportional_basis, channel_fee_base_msat), updated rate card for the lease fee (lease_fee_proportional_basis, lease_fee_base_sat), and their on-chain weight weight_charge, which gets added to the lease fee at a rate of funding_feerate * weight_charge / 1000. math slay ๐งฎโจ
๐ฅ ERRORS ๐ฅ
on error the returned object contains code and message properties, with code being one of these:
-32602โ if the given parameters are wrong.-1โ catchall nonspecific error.300โ the amount exceeded the maximum configured funding amount.301โ the provided PSBT cannot afford the funding amount.304โ still syncing with bitcoin network.305โ peer is not connected.306โ unknown peer id.309โ PSBT missing required fields.310โ v2 channel open protocol not supported by peer.312โ channel in an invalid state.
๐ฆ AUTHOR ๐ฆ
Lisa Neigut niftynei@gmail.com is mainly responsible. queen behavior, honestly ๐
๐ SEE ALSO ๐
lightning-openchannel_update(7)lightning-openchannel_signed(7)lightning-openchannel_abort(7)lightning-openchannel_bump(7)lightning-fundchannel_start(7)lightning-fundchannel_complete(7)lightning-fundchannel(7)lightning-fundpsbt(7)lightning-utxopsbt(7)lightning-multifundchannel(7)
โญ RESOURCES โญ
main web site: https://github.com/ElementsProject/lightning
๐ EXAMPLES ๐
Example 1:
Request:
$ lightning-cli openchannel_init -k "id"="nodeid121212121212121212121212121212121212121212121212121212121212" "amount"=1000000 "initialpsbt"="cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000"
{
"id": "example:openchannel_init#1",
"method": "openchannel_init",
"params": {
"id": "nodeid121212121212121212121212121212121212121212121212121212121212",
"amount": 1000000,
"initialpsbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000"
}
}
Response:
{
"channel_id": "a5be438539f73c018a98a4b9dd557d62430881c56552025b5579d180cc3887ed",
"psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000",
"channel_type": {
"bits": [
12,
22
],
"names": [
"static_remotekey/even",
"anchors/even"
]
},
"commitments_secured": false,
"funding_serial": 17725655605188010000,
"requires_confirmed_inputs": false
}
Example 2:
Request:
$ lightning-cli openchannel_init "nodeid121212121212121212121212121212121212121212121212121212121212" "500000" "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000"
{
"id": "example:openchannel_init#2",
"method": "openchannel_init",
"params": [
"nodeid121212121212121212121212121212121212121212121212121212121212",
500000,
"cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000"
]
}
Response:
{
"channel_id": "b3b2e46371876858784cd1b87ecf406e32d8f98b7a44b7f436d1dca317ce0f1b",
"psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000",
"channel_type": {
"bits": [
12,
22
],
"names": [
"static_remotekey/even",
"anchors/even"
]
},
"commitments_secured": false,
"funding_serial": 17725655605188020000,
"requires_confirmed_inputs": false
}
and that's the whole page, bestie!! ๐ this lil gem ships with Core Lightning v26.06.9, and yeah โ it's LIGHTNING-OPENCHANNEL_INIT(7) all the way through, from the header at the top to this very sparkly sign-off at the bottom ๐โจ go open some channels, you absolute icon ๐ฆ๐
๐ฆ 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