pub struct AnchorChannelsConfig {
pub trusted_peers_no_reserve: Vec<PublicKey>,
pub per_channel_reserve_sats: u64,
}Expand description
Configuration options pertaining to ‘Anchor’ channels, i.e., channels for which the
option_anchors_zero_fee_htlc_tx channel type is negotiated.
Prior to the introduction of Anchor channels, the on-chain fees paying for the transactions issued on channel closure were pre-determined and locked-in at the time of the channel opening. This required to estimate what fee rate would be sufficient to still have the closing transactions be spendable on-chain (i.e., not be considered dust). This legacy design of pre-anchor channels proved inadequate in the unpredictable, often turbulent, fee markets we experience today.
In contrast, Anchor channels allow to determine an adequate fee rate at the time of channel closure, making them much more robust in the face of fee spikes. In turn, they require to maintain a reserve of on-chain funds to have the channel closure transactions confirmed on-chain, at least if the channel counterparty can’t be trusted to do this for us.
See BOLT 3 for more technical details on Anchor channels.
§Defaults
| Parameter | Value |
|---|---|
trusted_peers_no_reserve | [] |
per_channel_reserve_sats | 25000 |
Fields§
§trusted_peers_no_reserve: Vec<PublicKey>A list of peers that we trust to get the required channel closing transactions confirmed on-chain.
Channels with these peers won’t count towards the retained on-chain reserve and we won’t take any action to get the required channel closing transactions confirmed ourselves.
Note: Trusting the channel counterparty to take the necessary actions to get the required Anchor spending transactions confirmed on-chain is potentially insecure as the channel may not be closed if they refuse to do so.
per_channel_reserve_sats: u64The amount of satoshis per anchors-negotiated channel with an untrusted peer that we keep as an emergency reserve in our on-chain wallet.
This allows for having the required Anchor output spending and HTLC transactions confirmed when the channel is closed.
If the channel peer is not marked as trusted via
AnchorChannelsConfig::trusted_peers_no_reserve, we will always try to spend the Anchor
outputs with any on-chain funds available, i.e., the total reserve value as well as any
spendable funds available in the on-chain wallet. Therefore, this per-channel multiplier is
really a emergency reserve that we maintain at all time to reduce reduce the risk of
insufficient funds at time of a channel closure. To this end, we will refuse to open
outbound or accept inbound channels if we don’t have sufficient on-chain funds available to
cover the additional reserve requirement.
Note: Depending on the fee market at the time of closure, this reserve amount might or might not suffice to successfully spend the Anchor output and have the HTLC transactions confirmed on-chain, i.e., you may want to adjust this value accordingly.
Trait Implementations§
Source§impl Clone for AnchorChannelsConfig
impl Clone for AnchorChannelsConfig
Source§fn clone(&self) -> AnchorChannelsConfig
fn clone(&self) -> AnchorChannelsConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AnchorChannelsConfig
impl Debug for AnchorChannelsConfig
Auto Trait Implementations§
impl Freeze for AnchorChannelsConfig
impl RefUnwindSafe for AnchorChannelsConfig
impl Send for AnchorChannelsConfig
impl Sync for AnchorChannelsConfig
impl Unpin for AnchorChannelsConfig
impl UnwindSafe for AnchorChannelsConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more