Skip to content

Wallet request expiry for mint quotes - #415

Open
thesimplekid wants to merge 2 commits into
cashubtc:mainfrom
thesimplekid:expiry_changes
Open

Wallet request expiry for mint quotes#415
thesimplekid wants to merge 2 commits into
cashubtc:mainfrom
thesimplekid:expiry_changes

Conversation

@thesimplekid

Copy link
Copy Markdown
Collaborator

No description provided.

Allow wallets to request a relative expiry for BOLT11 and BOLT12 mint quotes.
Advertise the maximum per method and return error 11018 when the requested
lifetime cannot be honored. Clarify each method's absolute response expiry.
Allow wallets to opt into an expiry that limits when onchain payments are
credited to a mint quote. Keep quotes open when no expiry is requested and
continue monitoring payments detected before expiry.
@robwoodgate

Copy link
Copy Markdown
Collaborator

Not sure I understand the rationale for this. Quote expiry binds the mint to a monitoring period - why would a wallet voluntarily reduce that and risk a payment being missed?

I kind of understand it in cases where the mint doesn't have an expiry and the wallet wants to enforce one. But mints committing to monitor quotes perpetually are just storing up pain for themselves in the future.

Comment thread 23.md
Wallets **SHOULD** use `amount_paid` and `amount_issued` instead of `state` whenever these fields are present.

`expiry` is the Unix timestamp until which the `request` can be paid (i.e. the bolt11 invoice expiry).
`expiry` is the invoice timestamp plus its BOLT11 expiry duration, expressed as a Unix timestamp. If `expiry_seconds` was set, it **MUST** be used as the invoice expiry duration.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should the default include a buffer for the HTLC timeouts too? If a payment is made close to LN invoice expiry, it may arrive after the expiry time and not be credited.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Mints should honor payments even expiry is reached. Wallets should do their best to check quotes that are technically expired but might have received a payment.

@thesimplekid

Copy link
Copy Markdown
Collaborator Author

Not sure I understand the rationale for this. Quote expiry binds the mint to a monitoring period - why would a wallet voluntarily reduce that and risk a payment being missed?

I kind of understand it in cases where the mint doesn't have an expiry and the wallet wants to enforce one. But mints committing to monitor quotes perpetually are just storing up pain for themselves in the future.

A wallet would want to reduce the number of quotes it must monitor. I think the best example for this is bolt12 right now. Currently, bolt12 never expires and this is useful for long running repeated payments however in the event bolt12 replaces bolt11 as the default invoice a wallet like numo would want to create short lived ones. Only the wallet knows if it wants a short one or the long one, so it must request and then the mint can decide if it supports this or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

4 participants