Skip to content

Bolt12 with support for multiple payments per mint quote#404

Closed
thesimplekid wants to merge 43 commits intocashubtc:mainfrom
thesimplekid:multiple_bolt12
Closed

Bolt12 with support for multiple payments per mint quote#404
thesimplekid wants to merge 43 commits intocashubtc:mainfrom
thesimplekid:multiple_bolt12

Conversation

@thesimplekid
Copy link
Collaborator

@thesimplekid thesimplekid commented Oct 13, 2024

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?

Related Issues should be closed by this PR

@thesimplekid thesimplekid marked this pull request as draft October 17, 2024 22:29
@thesimplekid thesimplekid force-pushed the multiple_bolt12 branch 5 times, most recently from 8717405 to 3f494bc Compare October 25, 2024 12:50
@thesimplekid thesimplekid changed the title Hackathone multiple payment to bolt12 Bolt12 with support for multiple payments per mint quote Oct 26, 2024
@thesimplekid thesimplekid mentioned this pull request Oct 26, 2024
@thesimplekid thesimplekid self-assigned this Oct 26, 2024
@thesimplekid thesimplekid force-pushed the multiple_bolt12 branch 2 times, most recently from e24f081 to b8198aa Compare October 30, 2024 13:21
@thesimplekid thesimplekid added new nut This PR is held pending the merge of a new or updated NUT and removed nut change labels Nov 18, 2024
async fn main() -> Result<()> {
let args: Cli = Cli::parse();
let default_filter = args.log_level;
let default_filter = "warn";
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

set back to arg

use cdk::nuts::{CurrencyUnit, PaymentMethod};
use cdk::wallet::multi_mint_wallet::{MultiMintWallet, WalletKey};
use cdk::Bolt11Invoice;
// use cdk::Bolt11Invoice;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
// use cdk::Bolt11Invoice;

Comment on lines +98 to +101
/// Amount that has been paid
pub amount_paid: Amount,
/// Amount that has been issued
pub amount_issued: Amount,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Move these to bolt12 specific

@average-gary
Copy link

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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

superseded by #709

@thesimplekid thesimplekid mentioned this pull request Apr 7, 2025
2 tasks
@thesimplekid
Copy link
Collaborator Author

close for #709

@github-project-automation github-project-automation bot moved this from In progress to Done in CDK Jun 10, 2025
@callebtc callebtc added this to eNuts Jul 8, 2025
@callebtc callebtc moved this to Backlog in eNuts Jul 8, 2025
@callebtc callebtc removed this from eNuts Jul 8, 2025
@thesimplekid thesimplekid deleted the multiple_bolt12 branch January 22, 2026 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request new nut This PR is held pending the merge of a new or updated NUT

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

CDK-CLI: Add command/flag to claim mints paid after exit

3 participants