openchannel

openchannel -- Hook fired when a peer proposes opening a channel using v1 protocol

DESCRIPTION

The openchannel hook is called whenever a remote peer tries to fund a channel using the v1 protocol, after passing basic sanity checks.

The payload mirrors the BOLT #2 open_channel message and may include additional fields defined by the protocol.

Plugins can reject the channel or modify certain parameters before accepting it.

This is a chained hook: the first plugin returning a non-"continue" result terminates the chain.
Mutation fields (close_to, mindepth, reserve) are only applied from the first plugin that sets them.
Additional fields may be present in the request as defined by BOLT #2.
Providing invalid values (e.g., invalid close_to address) will cause lightningd to exit.

HOOK PAYLOAD

  • openchannel (object):
    • id (pubkey): The peer's node_id.
    • funding_msat (msat): Funding amount proposed by the peer.
    • push_msat (msat): Amount pushed to us at channel open.
    • dust_limit_msat (msat): Dust limit for outputs.
    • max_htlc_value_in_flight_msat (msat): Maximum HTLC value allowed in flight.
    • channel_reserve_msat (msat): Channel reserve required by the peer.
    • htlc_minimum_msat (msat): Minimum HTLC value.
    • feerate_per_kw (u32): Feerate in satoshi per kw.
    • to_self_delay (u32): The number of blocks before they can take their funds if they unilateral close.
    • max_accepted_htlcs (u32): Maximum number of HTLC's the remote is allowed to offer at once.
    • channel_flags (u8): Channel flags as defined in BOLT #7.
    • channel_type (object) (added v25.09):
      • bits (array of u32s): List of feature bit numbers that define the negotiated channel type.
        Each value represents a feature bit as defined in BOLT #2.:
        • (u32, optional): Feature bit number.
      • names (array of strings): Human-readable names corresponding to each feature bit.
        Names are implementation-defined and may evolve over time.:
        • (string, optional): Name of the feature bit.
    • shutdown_scriptpubkey (hex, optional): Optional shutdown scriptPubKey proposed by the peer.

HOOK RETURN

  • result (string) (one of "continue", "reject"): Whether to accept or reject the channel opening request.
  • error_message (string, optional): Optional error message sent to the peer when rejecting.
  • close_to (string, optional): Bitcoin address for mutual close output.
    Must be valid for the current chain or lightningd will exit with an error.
  • mindepth (u32, optional): mindepth is the number of confirmations to require before making the channel usable.
    Notice that setting this to 0 (zeroconf) or some other low value might expose you to double-spending issues,
    so only lower this value from the default if you trust the peer not to double-spend, or you reject incoming payments,
    including forwards, until the funding is confirmed. (added v0.12.0)
  • reserve (sat, optional): reserve is an absolute value for the amount (in satoshi) in the channel that the peer must keep on their side.
    This ensures that they always have something to lose, so only lower this below the 1% of funding amount if you trust the peer.
    The protocol requires this to be larger than the dust limit, hence it will be adjusted to be the dust limit if the specified value is below. (added v22.11)

If result is present, and result is "reject":

  • error_message (string, optional)

Core Lightning is Blockstream's open-source implementation of the Lightning Network optimised for performance. It is highly customizable through modular expandability.

© 2026 Core Lightning, a Blockstream project.
All rights reserved.

X Twitter Logo Streamline Icon: https://streamlinehq.com

X

The official Core Lightning X(Twitter) handle to follow project updates and announcements.

Github Logo 2 Streamline Icon: https://streamlinehq.com

Github

Github repository for source code, issues, and contributions. Visit our project here to explore or contibute.

Telegram

Community-driven telegram group where most of the node operators hang out. Go to https://t.me/lightningd to join.

Discord

Community-driven discord server where the devs flock together. Go to https://discord.gg/V6ay9yNhBQ to join.