]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Add support for parsing the `dns_resolver` feature bit
authorMatt Corallo <git@bluematt.me>
Wed, 2 Oct 2024 18:12:38 +0000 (18:12 +0000)
committerMatt Corallo <git@bluematt.me>
Wed, 2 Oct 2024 18:24:40 +0000 (18:24 +0000)
This feature bit is used to indicate that a node will make DNS
queries on behalf of onion message senders, returning DNSSEC TXT
proofs for the requested names.

It is used to signal support for bLIP 32 resolution and can be used
to find nodes from which we can try to resolve BIP 32 HRNs.

lightning-types/src/features.rs

index 7ce87e0263ec30cb71f1eeb699d80a273308b581..f0d7f497f2bd600cd2c0fbf426a607c11d3aca55 100644 (file)
@@ -68,6 +68,8 @@
 //!     (see the [`Keysend` feature assignment proposal](https://github.com/lightning/bolts/issues/605#issuecomment-606679798) for more information).
 //! - `Trampoline` - supports receiving and forwarding Trampoline payments
 //!     (see the [`Trampoline` feature proposal](https://github.com/lightning/bolts/pull/836) for more information).
+//! - `DnsResolver` - supports resolving DNS names to TXT DNSSEC proofs for BIP 353 payments
+//!     (see [bLIP 32](https://github.com/lightning/blips/blob/master/blip-0032.md) for more information).
 //!
 //! LDK knows about the following features, but does not support them:
 //! - `AnchorsNonzeroFeeHtlcTx` - the initial version of anchor outputs, which was later found to be
@@ -177,6 +179,10 @@ mod sealed {
                        ZeroConf | Keysend,
                        // Byte 7
                        Trampoline,
+                       // Byte 8 - 31
+                       ,,,,,,,,,,,,,,,,,,,,,,,,
+                       // Byte 32
+                       DnsResolver,
                ]
        );
        define_context!(ChannelContext, []);
@@ -565,6 +571,17 @@ mod sealed {
                supports_trampoline_routing,
                requires_trampoline_routing
        );
+       define_feature!(
+               259,
+               DnsResolver,
+               [NodeContext],
+               "Feature flags for DNS resolving.",
+               set_dns_resolution_optional,
+               set_dns_resolution_required,
+               supports_dns_resolution,
+               requires_dns_resolution
+       );
+
        // Note: update the module-level docs when a new feature bit is added!
 
        #[cfg(any(test, feature = "_test_utils"))]