LIGHTNING-FUNDCHANNEL_START(7)

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

πŸ’… fundchannel_start β€” initiating channel establishment, the lowkey way πŸ¦‹

okay so bestie, you're reading the LIGHTNING-FUNDCHANNEL_START(7) page, straight out of the LIGHTNING manual (section 7, fancy). Sit down, grab a strawberry drink πŸ“, and let's get into it.


✨ NAME ✨

fundchannel_start β€” the command for initiating channel establishment for a lightning channel. it's giving "step one of a glow-up" energy πŸ‘‘


🌸 SYNOPSIS 🌸

fundchannel_start id amount [feerate announce close_to push_msat
channel_type mindepth reserve]

she's got a lot of optional args and honestly? iconic for that.


πŸ’– DESCRIPTION πŸ’–

okay so fundchannel_start is a lower level RPC command. it lets a user initiate channel establishment with a peer you're already connected to. think of it as sending the "hey bestie let's open a channel πŸ‘€" text.

⚠️ REAL TALK ⚠️ the funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed by running fundchannel_complete, because the commitment transactions for this channel are not secured until the complete command succeeds. broadcasting the transaction before that can lead to unrecoverable loss of funds. like... actual money, gone, no cap. πŸ˜­πŸ’€

here's the whole cast of parameters, one by one:

  • id (pubkey) β€” the peer id you got from connect. bestie's name tag πŸŽ€
  • amount (sat) β€” the Satoshi value that the channel will be funded at. this value MUST be accurate, otherwise the negotiated commitment transactions will not encompass the correct channel value. no rounding shenanigans, fr fr.
  • feerate (feerate, optional) β€” feerate for subsequent commitment transactions: see fundchannel. heads up though, this is ignored for channels with option_anchors (we always use a low commitment fee for these).
  • announce (boolean, optional) β€” whether or not to announce this channel. do you want the world to know, or is this private? πŸ™ˆ
  • close_to (string, optional) β€” a Bitcoin address to which the channel funds should be sent to on close. only valid if both peers have negotiated option_upfront_shutdown_script. returns close_to set to the closing script iff is negotiated.
  • push_msat (msat, optional) β€” amount of millisatoshis to push to the channel peer at open. note that this is a gift to the peer β€” these satoshis are added to the initial balance of the peer at channel start and are largely unrecoverable once pushed. it's giving "venmo-ing your ex" energy, be careful πŸ’ΈπŸ˜­
  • mindepth (u32, optional) β€” number of confirmations required before we consider the channel active. patience is a virtue etc etc ⏳
  • reserve (sat, optional) β€” the amount we want the peer to maintain on its side.
  • channel_type (array of u32s, optional) β€” each bit set in this channel_type:
    • (u32, optional) β€” bit number. cute little number, that's it 🌈

πŸŽ€ RETURN VALUE πŸŽ€

on success, an object is returned, containing:

  • funding_address (string) β€” the address to send funding to for the channel. DO NOT SEND COINS TO THIS ADDRESS YET. like please, I am begging 🫢
  • scriptpubkey (hex) β€” the raw scriptPubKey for the address.
  • channel_type (object, optional) β€” channel_type as negotiated with peer. (added v24.02):
    • bits (array of u32s) β€” each bit set in this channel_type. (added v24.02):
      • (u32, optional) β€” bit number.
    • names (array of strings) β€” feature name for each bit set in this channel_type. note that anchors_zero_fee_htlc_tx is a deprecated synonym for anchors. (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.
  • close_to (hex, optional) β€” the raw scriptPubkey which mutual close will go to; only present if close_to parameter was specified and peer supports option_upfront_shutdown_script.
  • mindepth (u32, optional) β€” number of confirmations before we consider the channel active.

the following warnings may also be returned:

  • warning_usage β€” a warning not to prematurely broadcast the funding transaction (always present!). yes, always. she never misses πŸ’…

πŸ”₯ ERRORS πŸ”₯

on error the returned object will contain code and message properties, with code being one of the following:

  • -32602 β€” if the given parameters are wrong. vibe check failed πŸ’€
  • -1 β€” catchall nonspecific error. the classic "idk what happened" 😭
  • 300 β€” the amount exceeded the maximum configured funding amount.
  • 301 β€” the provided push_msat is greater than the provided amount. math is not mathing.
  • 304 β€” still syncing with bitcoin network.
  • 305 β€” peer is not connected.
  • 306 β€” unknown peer id.
  • 312 β€” peer negotiated option_dual_fund, must use openchannel_init not fundchannel_start. (only if experimental-dual-fund is enabled)

πŸ‘‘ AUTHOR πŸ‘‘

Lisa Neigut niftynei@gmail.com is mainly responsible. give her her flowers, she ate πŸ’


🌈 SEE ALSO 🌈

lightning-connect(7), lightning-fundchannel(7), lightning-multifundchannel(7), lightning-fundchannel_complete(7), lightning-fundchannel_cancel(7), lightning-openchannel_init(7), lightning-openchannel_update(7), lightning-openchannel_signed(7), lightning-openchannel_bump(7), lightning-openchannel_abort(7)

the whole friend group, honestly 🫢


⭐ RESOURCES ⭐

main web site: https://github.com/ElementsProject/lightning


🧚 EXAMPLES 🧚

Example 1:

request:

$ lightning-cli fundchannel_start "nodeid101010101010101010101010101010101010101010101010101010101010" "16777216"

{
  "id": "example:fundchannel_start#1",
  "method": "fundchannel_start",
  "params": [
    "nodeid101010101010101010101010101010101010101010101010101010101010",
    16777216
  ]
}

response:

{
  "funding_address": "bcrt1p0002020202020202020202020202020202020202020202020202020202",
  "scriptpubkey": "scriptpubkey01010101010101010101010101010101010101010101010101010101",
  "channel_type": {
    "bits": [
      12,
      22
    ],
    "names": [
      "static_remotekey/even",
      "anchors/even"
    ]
  },
  "warning_usage": "The funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed by running `fundchannel_complete`"
}

Example 2:

request:

$ lightning-cli fundchannel_start -k "id"="nodeid101010101010101010101010101010101010101010101010101010101010" "amount"=16777216

{
  "id": "example:fundchannel_start#2",
  "method": "fundchannel_start",
  "params": {
    "id": "nodeid101010101010101010101010101010101010101010101010101010101010",
    "amount": 16777216
  }
}

response:

{
  "funding_address": "bcrt1p0003030303030303030303030303030303030303030303030303030303",
  "scriptpubkey": "scriptpubkey02020202020202020202020202020202020202020202020202020202",
  "channel_type": {
    "bits": [
      12,
      22
    ],
    "names": [
      "static_remotekey/even",
      "anchors/even"
    ]
  },
  "warning_usage": "The funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed by running `fundchannel_complete`"
}

and that's the whole page bestie! this lil masterpiece is from Core Lightning v26.06.9 and it's the LIGHTNING-FUNDCHANNEL_START(7) page β€” go forth and start some channels (just, like, don't broadcast yet, ok?? love u πŸ’œπŸ¦‹βœ¨)

πŸ“¦ where this page comes from