Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Refactor unified_qr.rs to use bitcoin-payment-instructions #666

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

Open
chuksys wants to merge 8 commits into lightningdevkit:main
base: main
Choose a base branch
Loading
from chuksys:refactor/adopt-bitcoin-payment-instructions

Conversation

@chuksys
Copy link

@chuksys chuksys commented Oct 16, 2025
edited
Loading

This PR is a continuation of #607 which was closed mistakenly when the develop base branch was deleted.

This PR introduces a unified.rs module (which is a refactor of the unified_qr.rs module) - this refactor allows us to use this module as a single API for sending payments to BIP 21/321 URIs as well as BIP 353 HRNs, creating a simpler interface for users.

https://github.com/rust-bitcoin/bitcoin-payment-instructions is used to parse BIP 21/321 URIs as well as the BIP 353 HRNs.

Changes

  • The unified_qr.rs module has been renamed to unified.rs.
  • The UnifiedQrPayment struct has been renamed to UnifiedPayment.
  • The QRPaymentResult enum has been renamed to UnifiedPaymentResult.
  • The send method in unified.rs now supports sending to both BIP 21/321 URIs as well as BIP 353 HRNs.
  • The integration tests for the module have been updated accordingly.

This PR closes #521

Copy link

ldk-reviews-bot commented Oct 16, 2025
edited
Loading

I've assigned @tnull as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

Copy link

🔔 1st Reminder

Hey @tnull! This PR has been waiting for your review.
Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

Copy link

🔔 2nd Reminder

Hey @tnull! This PR has been waiting for your review.
Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

Copy link

🔔 3rd Reminder

Hey @tnull! This PR has been waiting for your review.
Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

Copy link

🔔 4th Reminder

Hey @tnull! This PR has been waiting for your review.
Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

Copy link

🔔 5th Reminder

Hey @tnull! This PR has been waiting for your review.
Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

Copy link

🔔 6th Reminder

Hey @tnull! This PR has been waiting for your review.
Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

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.

This needs a rebase by now, sorry!

chuksys reacted with thumbs up emoji
This rename reflects that this module is a unified payment interface for both QR code payments and HRN payments passed in as a string without scanning a QR code
@chuksys chuksys force-pushed the refactor/adopt-bitcoin-payment-instructions branch from a6dab4e to 1e7d616 Compare November 2, 2025 22:02
...UnifiedPaymentResult
These renamings are necessary to reflect the expanded responsibilities for this module.
This commit adds a HRN Resolver to the Node struct which will be useful for resolving HRNs when making BIP 353 payments. It also passes the HRN Resolver into UnifiedPayment.
This commit ensures that when using the unified API to send to a HRN, we use pay_for_offer_from_hrn
@chuksys chuksys force-pushed the refactor/adopt-bitcoin-payment-instructions branch from 1e7d616 to 3e30347 Compare November 2, 2025 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@tnull tnull tnull left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Switch to use bitcoin-payment-instructions

AltStyle によって変換されたページ (->オリジナル) /