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 Bolt12Invoice #605

Merged
merged 2 commits into from
Feb 19, 2024
Merged

Add Bolt12Invoice #605

merged 2 commits into from
Feb 19, 2024

Conversation

thomash-acinq
Copy link
Member

Adds types for Bolt 12 invoice.
PaymentRequest is now an interface that can be either a Bolt11Invoice (the old PaymentRequest) or a Bolt12Invoice.

Replaces #600

@thomash-acinq thomash-acinq requested a review from t-bast February 16, 2024 15:35
@thomash-acinq thomash-acinq merged commit e7db57c into master Feb 19, 2024
2 checks passed
@thomash-acinq thomash-acinq deleted the invoice branch February 19, 2024 16:52
@dpad85
Copy link
Member

dpad85 commented Feb 20, 2024

Small feature request for PaymentRequest: add a write method (and maybe a read as well) that would branch to either Bolt11Invoice.write or Bolt12Invoice.write.

There are some objects (like LightningOutgoingPayment.Details.SwapOut in the database) that contain a PaymentRequest attribute, and it would be handy to have a method to print the invoice without having to manually cast it beforehand. Maybe in a future PR? 🙏 😇

@thomash-acinq
Copy link
Member Author

@dpad85 Added in #607

dpad85 added a commit to ACINQ/phoenix that referenced this pull request Feb 20, 2024
- Either, Try, Chain are now provided by bitcoin-kmp
- NodeParams has been simplified
- Added a new Bolt12Invoice type; PaymentRequest is
  an interface.

See:
ACINQ/lightning-kmp#590
ACINQ/lightning-kmp#603
ACINQ/lightning-kmp#605
dpad85 added a commit to ACINQ/phoenix that referenced this pull request Feb 22, 2024
Phoenix now uses lightning-kmp 1.6.1, with support for
taproot addresses and address rotation, improving
privacy and making swap transactions slightly cheaper.

The swap-in wallet now exposes a flow containing the current
address, and a flow of addresses that have already been used 
(plus the current unused address, and a static native segwit
address). Future unused addresses are not exposed.

Swaps to the legacy address will still work, however usage 
should be discouraged. By default, we use taproot addresses.

The swap-in model/intent has been removed from the shared
ReceiveController.

Since the swap-in wallet may take time to synchronize all
used addresses at startup, the app stores the last known
unused index in its preferences, and uses that index when
the app starts to display an address while synchronising.
There's a small risk of address reuse at startup.

Some maintenance work has also been made. With lightning-
kmp version 1.6, several APIs have changed:
- Either, Try, Chain are now provided by bitcoin-kmp
- NodeParams has been simplified
- Added a new Bolt12Invoice type; PaymentRequest is
  an interface.

See:
ACINQ/lightning-kmp#590
ACINQ/lightning-kmp#603
ACINQ/lightning-kmp#605

---------

Co-authored-by: Robbie Hanson <[email protected]>
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