WIP: Bolt12 with support for multiple payments per mint quote #404

Closed
thesimplekid wants to merge 43 commits from multiple_bolt12 into main
thesimplekid commented 2024-10-13 07:46:07 +00:00 (Migrated from github.com)

This PR included bolt12 support for both the mint and the wallet. It also includes a large refactor of mintd, these really should have been separated but too late now (sorry).

Backend Send Receive
CLN ✔️ ✔️
LND* 🚧
PHD** ✔️
LNBITS
Strike***

* With use of LNDK as lnd does not directly support bolt12
** PHD doesnt allow creation of one time use bolt12, so receive cannot be supported
*** Strike api doesn't seem to support bolt12, coming soon?

This PR included bolt12 support for both the mint and the wallet. It also includes a large refactor of mintd, these really should have been separated but too late now (sorry). | Backend | Send | Receive | |----------|------|---------| | CLN | :heavy_check_mark: | :heavy_check_mark: | | LND\* | :construction: | :x: | | PHD** | :heavy_check_mark: | :x: | | LNBITS | :x: | :x: | | Strike*** | :question: | :question: | \* With use of LNDK as lnd does not directly support bolt12 ** PHD doesnt allow creation of one time use bolt12, so receive cannot be supported *** Strike api doesn't seem to support bolt12, coming soon? ### Related Issues should be closed by this PR - [ ] Should also close #355, this logic is handled for bolt12 use same logic for bolt11 - [x] https://github.com/cashubtc/cdk/issues/430
mubarak23 (Migrated from github.com) reviewed 2024-11-20 10:46:20 +00:00
@ -0,0 +1,102 @@
use tracing::instrument;
mubarak23 (Migrated from github.com) commented 2024-11-20 10:46:20 +00:00

can we change this to reflect Bolt12 -> Bolt12 mint request for unsupported unit

can we change this to reflect Bolt12 -> ` Bolt12 mint request for unsupported unit`
thesimplekid (Migrated from github.com) reviewed 2024-11-21 22:51:48 +00:00
thesimplekid (Migrated from github.com) commented 2024-10-25 12:16:51 +00:00

set back to arg

set back to arg
@ -3,9 +3,9 @@ use std::io::Write;
use std::str::FromStr;
thesimplekid (Migrated from github.com) commented 2024-10-25 12:18:12 +00:00
```suggestion ```
@ -90,6 +94,9 @@ pub struct MintQuoteBolt11Response {
pub state: MintQuoteState,
/// Unix timestamp until the quote is valid
thesimplekid (Migrated from github.com) commented 2024-10-25 12:55:21 +00:00

Move these to bolt12 specific

Move these to bolt12 specific
average-gary commented 2025-04-03 13:41:15 +00:00 (Migrated from github.com)

crate/cdk/src/mint/mod.rs -> fn wait_for_paid_offers() -> bolt12.wait_any_offer() -> mint.pay_mint_quote_for_request_id() -> crates/cdk/src/mint/mint_nut04.rs -> self.pubsub_manager.mint_quote_bolt11_status() -> event is broadcast as a something that can become MintQuoteBolt11Response

Dropping this comment to see if there will/should be a Bolt12 specific event for this? or are the Quotes relatively the same for 11 and 12 that this works for both? For context, I'm interested in subbing to events that occur when Bolt12 offers are paid and this seems like the right place. If I'm off-base in my understand, perhaps there's a better way of being alerted to a Bolt12 offer being paid?

`crate/cdk/src/mint/mod.rs` -> `fn wait_for_paid_offers()` -> `bolt12.wait_any_offer()` -> `mint.pay_mint_quote_for_request_id()` -> `crates/cdk/src/mint/mint_nut04.rs` -> `self.pubsub_manager.mint_quote_bolt11_status()` -> event is broadcast as a something that can become `MintQuoteBolt11Response` Dropping this comment to see if there will/should be a Bolt12 specific event for this? or are the Quotes relatively the same for 11 and 12 that this works for both? For context, I'm interested in subbing to events that occur when Bolt12 offers are paid and this seems like the right place. If I'm off-base in my understand, perhaps there's a better way of being alerted to a Bolt12 offer being paid?
thesimplekid commented 2025-04-04 11:27:55 +00:00 (Migrated from github.com)

Dropping this comment to see if there will/should be a Bolt12 specific event for this? or are the Quotes relatively the same for 11 and 12 that this works for both? For context, I'm interested in subbing to events that occur when Bolt12 offers are paid and this seems like the right place. If I'm off-base in my understand, perhaps there's a better way of being alerted to a Bolt12 offer being paid?

I haven't thought about this since i did this before websockets but I think this is a good point I think the mint should send a notification each time the mint quote is paid for quote thats payable multiple times. I'm picking this pack up and will add this as well.

> Dropping this comment to see if there will/should be a Bolt12 specific event for this? or are the Quotes relatively the same for 11 and 12 that this works for both? For context, I'm interested in subbing to events that occur when Bolt12 offers are paid and this seems like the right place. If I'm off-base in my understand, perhaps there's a better way of being alerted to a Bolt12 offer being paid? I haven't thought about this since i did this before websockets but I think this is a good point I think the mint should send a notification each time the mint quote is paid for quote thats payable multiple times. I'm picking this pack up and will add this as well.
thesimplekid commented 2025-04-07 13:53:31 +00:00 (Migrated from github.com)
superseded by https://github.com/cashubtc/cdk/pull/709
thesimplekid commented 2025-06-10 12:21:45 +00:00 (Migrated from github.com)
close for https://github.com/cashubtc/cdk/pull/709

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cashubtc/cdk!404
No description provided.