LIGHTNING-HOOK-RBF_CHANNEL(7)
π
rbf_channel β a hook, bestie, from lightning-hook-rbf_channel(7)
okay so picture this: this whole page is about the rbf_channel hook, and it lives in section 7 of the manual. it's a plugin hook, it's giving main character energy, and it's literally the thing that handles RBF channel funding requests. stay with me, it's not that deep, I promise π«Ά
β¨ DESCRIPTION β¨
so the rbf_channel hook gets called when a peer proposes replacing the funding transaction of an existing channel using Replace-By-Fee (RBF). like, they wanna swap out the funding tx for a shinier one π₯
your plugin gets to be the one to decide: reject it, or let the negotiation continue. you're the vibe check here, no cap.
if you choose to continue, your plugin is allowed to contribute additional inputs and outputs by returning a PSBT and specifying an our_funding_msat amount. cute, right? you're literally adding to the pot πΈ
now the important bit, and do NOT skip this:
the our_funding_msat value must not be included in any output in the PSBT. like, ever. that's the rule.
change outputs should be included and calculated using the provided funding_feerate_per_kw. that's the number you do your math with, bestie, don't freelance it π
πΈ HOOK PAYLOAD πΈ
here's everything that gets handed to you, all wrapped up in one object:
rbf_channel(object):id(pubkey) β thenode_idof the peer proposing the RBF. so you know exactly who's asking πchannel_id(hash) β thechannel_idof the channel being modified.their_last_funding_msat(msat) β the peer's previous contribution to the funding transaction.their_funding_msat(msat) β the peer's proposed new funding contribution.our_last_funding_msat(msat) β our previous contribution to the funding transaction.funding_feerate_per_kw(u32) β the feerate to use for the updated funding transaction, in satoshis per kw.feerate_our_max(u32) β the maximum feerate we are willing to accept for the funding transaction.feerate_our_min(u32) β the minimum feerate we are willing to accept for the funding transaction.channel_max_msat(msat) β the maximum total channel capacity allowed for this channel.locktime(u32) β the locktime to use for the funding transaction.require_confirmed_inputs(boolean) β indicates whether the remote peer requires all inputs in the PSBT to be confirmed. iftrue, the plugin must avoid adding unconfirmed inputs. this one was added in v23.02, iconic βrequested_lease_msat(msat, optional) β if present, the amount of liquidity the peer is requesting us to lease. this field is optional and only included if the peer requested a lease. so if it's not there, don't go looking for it π
π HOOK RETURN π
and here's what you send back:
result(string) (one of"continue","reject") β whether to accept or reject the RBF proposal. pick your fighter.psbt(string, optional) β a PSBT containing additional inputs and outputs to contribute to the funding transaction. only valid ifresultiscontinue. so don't be sneaky with it π«Άour_funding_msat(msat, optional) β the amount we are contributing to the new funding transaction. must not be included in any output in the PSBT. (yes, again. it's that serious.)error_message(string, optional) β an error message explaining the rejection. only used ifresultisreject, and it will be sent to the peer. so be nice, or at least be clear lmao π¨
π¦ a lil sign-off π¦
that's the whole page, bestie β no filler, no fluff, every field accounted for. this one ships with Core Lightning v26.06.9, and the page is dated to match. slay, go write a plugin, you've got this ππ
π¦ 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