AnchorChannelsConfig

Struct AnchorChannelsConfig 

Source
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

ParameterValue
trusted_peers_no_reserve[]
per_channel_reserve_sats25000

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: u64

The 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

Source§

fn clone(&self) -> AnchorChannelsConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AnchorChannelsConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for AnchorChannelsConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more