Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add/implement HRN (Human-Readable Name) support using a sub-module #437

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Dhanraj30
Copy link

hrn.rs | New file for HRN-related functionality.
mod.rs | Expose the HrnPayment struct and its methods.
error.rs | Add new error variants for HRN resolution failures.
store.rs | Extend PaymentDetails to include HRN metadata if needed.

TODO:

Implement the actual HRN resolution logic in the resolve_hrn_to_offer method.

Copy link
Collaborator

@tnull tnull left a comment

Choose a reason for hiding this comment

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

Thanks for looking into this, but it seems this PR is unfortunately going in the wrong direction.

LDK 0.1 already implements everything needed for HRN resolution when using the pay_for_offer_from_human_readable_name API.

We however need to implement some logic to retrieve, rank, and filter DNS resolver Destinations from the network graph, and possibly also allowing the user to override specific DNS resolvers via theConfig objects, which all need to be exposeable in Uniffi bindings.

I'm also still not sure if at the current state (where LDK's API only supports paying Offers from HRNs), we already need a new payment API object, or if this should just live on Bolt12Payment for now.

Error::OfferCreationFailed
})?;

let offer = offer_builder
Copy link

@TheBlueMatt TheBlueMatt Jan 20, 2025

Choose a reason for hiding this comment

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

You're building an offer which we can use to receive payment to ourselves and then trying to pay it, paying ourselves. Instead, you need to look at the lightning-dns-resolver crate and its contained resolver to resolve the HRN to a URI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants