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

Bolt12 #170

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Bolt12 #170

wants to merge 10 commits into from

Conversation

thesimplekid
Copy link
Collaborator

@thesimplekid thesimplekid commented Oct 4, 2024

  • CDK
  • Nutshell
  • cashu-ts
  • gonuts
  • nutmix

@lollerfirst
Copy link
Contributor

lollerfirst commented Oct 18, 2024

Following up on your hackaton presentation at BTC++ we could make it so that a bolt12 quote has a different status enum:

  • EMPTY
  • MINTABLE
  • RETIRED

The states can go from EMPTY to MINTABLE and back, but once the quote is RETIRED no more state changes.
One might always expect to save and re-use the same quote to mint ecash multiple times, as that is the purpose of the bolt12 (to be paid multiple times).

And then we might introduce a new endpoint through which one can retire the quote.

@thesimplekid thesimplekid marked this pull request as draft October 22, 2024 16:17
@thesimplekid thesimplekid force-pushed the bolt12 branch 2 times, most recently from 63bf4eb to 55355b0 Compare October 25, 2024 19:13
@thesimplekid thesimplekid marked this pull request as ready for review October 25, 2024 19:13
19.md Outdated

Where `quote` is the quote ID and `request` is the bolt12 offer. `expiry` is the Unix timestamp until which the mint quote is valid. `amount_paid` is the amount that has been paid to the mint via the bolt12 offer. `amount_issued` is the amount of ecash that has been issued for the given mint quote. `amount_paid` - `amount_issued` represents the amount of ecash a wallet can still mint.

Note: `quote` is a **unique and random** id generated by the mint to internally look up the payment state. `quote` **MUST** remain a secret between user and mint and **MUST NOT** be derivable from the payment request. A third party who knows the `quote` ID can front-run and steal the ecash that this operation mints.
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to specify the length and type of the quote? For example, 64 char hex string?

IMO that makes it clear for implementors and avoids quick-and-dirty (and-insecure) solutions like incrementing from 1, or current unix timestamp, etc.

This also avoids complications if some mints decide to try out exotic characters, which some wallets may not expect.

20.md Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new nut A new protocol NUT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants