Support paying directly to Human Readable Names using bLIP 32
Based on #3179 this fully implements BIP 353 sends using bLIP 32 DNS resolution with a wonderfully simple API:
pub fn pay_for_offer_from_human_readable_name(
&self, name: HumanReadableName, amount_msats: u64, payment_id: PaymentId,
retry_strategy: Retry, max_total_routing_fee_msat: Option<u64>,
dns_resolvers: Vec<Destination>,
) -> Result<(), ()> {
Still needs a few trivial things piped out through to events (eg DNSSEC proofs as "proof of payment"), but its basically done!
Codecov Report
Attention: Patch coverage is 85.27132% with 76 lines in your changes missing coverage. Please review.
Project coverage is 89.67%. Comparing base (
b0bd437) to head (cbdb8cb). Report is 9 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #3283 +/- ##
==========================================
+ Coverage 89.65% 89.67% +0.02%
==========================================
Files 128 129 +1
Lines 104821 105419 +598
Branches 104821 105419 +598
==========================================
+ Hits 93980 94538 +558
- Misses 8130 8138 +8
- Partials 2711 2743 +32
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Should be ready for review now that the dependent PR landed @arik-so @tnull
Added a commit to set the feature bit added in #3346.
Rebased and addressed CI issues.
I'm good with squashing the fixups at this point.
Squashed the fixups without further changes.
Addressed feedback and rebased.
Squashed without further changes.
Squashed without changes then had to rebase to address a conflict:
$ git range-diff 8c086c772f2f4def5aecc549b2d39f2ab427081d..ce3b143c314ffb640dbdb569dd6c8882e008a0f3 b0bd4371d989722aa38ddfc2f35db8922e3304bb..cbdb8cb0cb5f1e8b9e676ad2d130b8bbc2b9e640
1: 3fdc51c8b = 1: a39e274e3 Skip the implicit trailing `.` in `HumanReadableName`'s domain
2: 126f7f455 = 2: 46df35b0f Add a new `AwaitingOffer` outbound payment state for BIP 353
3: 84887e686 = 3: e447b4913 Add support for storing a source HRN in BOLT 12 `invoice_request`s
4: 6aa1bb2bc = 4: 8d8416b95 Store the source `HumanReadableName` in `InvoiceRequestFields`
5: 10eb7cf8a ! 5: 99d00930a Support paying Human Readable Names directly from `ChannelManager`
@@ lightning/src/ln/channelmanager.rs: where
/// to pay us.
///
@@ lightning/src/ln/channelmanager.rs: where
- payment_secrets.retain(|_, inbound_payment| {
- inbound_payment.expiry_time > header.time as u64
- });
+ }
+ }
+ max_time!(self.highest_seen_timestamp);
+ #[cfg(feature = "dnssec")] {
+ let timestamp = self.highest_seen_timestamp.load(Ordering::Relaxed) as u32;
+ self.hrn_resolver.new_best_block(height, timestamp);
6: ef273123b = 6: 2bbb3b708 Use `ChannelManager` as `DNSResolverMessageHandler` by default
7: af3c4accf = 7: 8e941426c Add a `lightning-dns-resolver` crate which answers bLIP 32 queries
8: ce3b143c3 = 8: cbdb8cb0c Set the `dns_resolution` feature in `OMDomainResolver`