home | help
LIGHTNING-HOOK-OPENCHANNEL(7)			   LIGHTNING-HOOK-OPENCHANNEL(7)

NAME
     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 chan-
     nel using the v1 protocol, after passing basic sanity checks.

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

     Plugins  can reject the channel or modify certain parameters before accept-
     ing 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  al-
	   lowed 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 ne-
	   gotiated  channel  type.   Each value represents a feature bit as de-
	   fined 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  re-
	ject 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 er-
	ror.
     *	mindepth (u32, optional): mindepth is the number of confirmations to re-
	quire 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 for-
	wards, 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 en-
	sures 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, op-
     tional)

Core Lightning v26.06.1 			   LIGHTNING-HOOK-OPENCHANNEL(7)

home | help