1

For testing purposes, I want to reduce the number of confirmations required until a LDK-based Lightning node deems a channel ready for operation.

How can I accomplish this?

1 Answer 1

2

According to the BOLT #2 specs, the non-funding counterparty indicates which confirmation depth it is willing to accept via the minimum_depth field in the accept_channel message.

In LDK you can configure this for inbound channels via ChannelHandshakeConfig::minimum_depth and the opening counterparty can limit what maximum value it is willing to accept via ChannelHandshakeLimits::max_minimum_depth.

Note that you may also want to enable zero confirmation channels. For outbound channels you can simply enable this via setting ChannelHandshakeLimits::trust_own_fundings_0conf. As inbound zero confirmation channels are a risk for the accepting party, LDK requires you to manually check and accept each such channel. You can enable this by setting UserConfig::manually_accept_inbound_channels, upon which you'll start receiving an OpenChannelRequest event for each inbound channel. For each request you want to accept you then need to call ChannelManager::accept_inbound_channel_from_trusted_peer_0conf, or can force-close the channel otherwise.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.