Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions bindings/ldk_node.udl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dictionary Config {
u64 probing_liquidity_limit_multiplier;
AnchorChannelsConfig? anchor_channels_config;
RouteParametersConfig? route_parameters;
HumanReadableNamesConfig? hrn_config;
};

dictionary AnchorChannelsConfig {
Expand Down Expand Up @@ -501,6 +502,12 @@ dictionary RouteParametersConfig {
u8 max_channel_saturation_power_of_half;
};

dictionary HumanReadableNamesConfig {
sequence<PublicKey> default_dns_resolvers;
boolean is_hrn_resolver;
string dns_server_address;
};

dictionary CustomTlvRecord {
u64 type_num;
sequence<u8> value;
Expand Down
35 changes: 34 additions & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ pub(crate) const HRN_RESOLUTION_TIMEOUT_SECS: u64 = 5;
/// | `probing_liquidity_limit_multiplier` | 3 |
/// | `log_level` | Debug |
/// | `anchor_channels_config` | Some(..) |
/// | `route_parameters` | None |
/// | `route_parameters` | None |
/// | `hrn_config` | Some(..) |
///
/// See [`AnchorChannelsConfig`] and [`RouteParametersConfig`] for more information regarding their
/// respective default values.
Expand Down Expand Up @@ -184,6 +185,10 @@ pub struct Config {
/// **Note:** If unset, default parameters will be used, and you will be able to override the
/// parameters on a per-payment basis in the corresponding method calls.
pub route_parameters: Option<RouteParametersConfig>,
/// Configuration options for Human-Readable Names ([BIP 353]).
///
/// [BIP 353]: https://github.com/bitcoin/bips/blob/master/bip-0353.mediawiki
pub hrn_config: Option<HumanReadableNamesConfig>,
}

impl Default for Config {
Expand All @@ -198,6 +203,34 @@ impl Default for Config {
anchor_channels_config: Some(AnchorChannelsConfig::default()),
route_parameters: None,
node_alias: None,
hrn_config: Some(HumanReadableNamesConfig::default()),
}
}
}

/// Configuration options for Human-Readable Names ([BIP 353]).
///
/// [BIP 353]: https://github.com/bitcoin/bips/blob/master/bip-0353.mediawiki
#[derive(Debug, Clone)]
pub struct HumanReadableNamesConfig {
/// The Default DNS resolvers to be used for resolving Human-Readable Names.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Can just drop Default, no?

///
/// If not empty, the values set will be used as DNS resolvers when sending to HRNs.
///
/// **Note:** If empty, DNS resolvers would be selected from the network graph.
pub default_dns_resolvers: Vec<PublicKey>,
/// This allows us to use our node as a DNS resolver for 3rd party HRN resolutions.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: This is oddly formulated: if set this allows others to use our nodes for HRN resolutions, no? Probably also want to link to the bLIP here?

pub is_hrn_resolver: bool,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, maybe we should make this a disable_hrn_resolution_service bool and default to acting as a bLIP-32 service when all requirements to announce the node are met and the user didn't explicitly opt-out.

/// The DNS Server which will be used for resolving HRNs.
pub dns_server_address: String,
Copy link
Collaborator

@tnull tnull Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is confusing. How does this interact with default_dns_resolvers? Should we rather add an enum that allows user to either configure bLIP-32 onion-message based resolvers or a DNS server used for resolution?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we rather add an enum that allows user to either configure bLIP-32 onion-message based resolvers or a DNS server used for resolution?

Yes! that makes sense to me.

}

impl Default for HumanReadableNamesConfig {
fn default() -> Self {
HumanReadableNamesConfig {
default_dns_resolvers: Vec::new(),
is_hrn_resolver: false,
dns_server_address: String::new(),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/ffi/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub use vss_client::headers::{VssHeaderProvider, VssHeaderProviderError};
use crate::builder::sanitize_alias;
pub use crate::config::{
default_config, AnchorChannelsConfig, BackgroundSyncConfig, ElectrumSyncConfig,
EsploraSyncConfig, MaxDustHTLCExposure,
EsploraSyncConfig, HumanReadableNamesConfig, MaxDustHTLCExposure,
};
pub use crate::entropy::{generate_entropy_mnemonic, EntropyError, NodeEntropy, WordCount};
use crate::error::Error;
Expand Down