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

NUT-XX: signature on mint request #188

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

Conversation

thesimplekid
Copy link
Collaborator

@thesimplekid thesimplekid commented Nov 10, 2024

This NUT defines a protocol extension that enables signature-based authentication for mint quote redemption. When requesting a mint quote, clients can provide a public key. The mint will then require a valid signature from the corresponding secret key before processing the mint.

This is defined as an optional extension to NUT-04 and the intention is to reuse it and make it mandatory for bolt12 and onchain.

@thesimplekid thesimplekid added the new nut A new protocol NUT label Nov 10, 2024
19.md Outdated Show resolved Hide resolved
@lollerfirst
Copy link
Contributor

@thesimplekid Should we make it clear that wallets should use an ephemeral (one time) key?

error_codes.md Outdated Show resolved Hide resolved
@thesimplekid
Copy link
Collaborator Author

@thesimplekid Should we make it clear that wallets should use an ephemeral (one time) key?

Added note on this

19.md Outdated Show resolved Hide resolved
19.md Outdated Show resolved Hide resolved
19.md Outdated Show resolved Hide resolved
19.md Outdated Show resolved Hide resolved
19.md Outdated Show resolved Hide resolved
19.md Outdated Show resolved Hide resolved
error_codes.md Outdated Show resolved Hide resolved
@thesimplekid thesimplekid force-pushed the sign_mint_quote branch 3 times, most recently from f866a25 to a4349b5 Compare November 21, 2024 09:51
@thesimplekid thesimplekid mentioned this pull request Nov 21, 2024
5 tasks
@callebtc callebtc changed the title feat: nut19 signature on mint request NUT-XX: signature on mint request Nov 25, 2024
19.md Outdated
Comment on lines 165 to 67
```json
{
"19": {
"supported": <bool>,
"required": <bool>
}
}
```

In addition to signaling optional support, the mint can require a public key for mint quotes and a corresponding signature during minting. If `required` is set to `true` in the NUT-19 settings:

1. The wallet **MUST** provide a public key when requesting a mint quote
2. The wallet **MUST** provide a valid witness signature when submitting the mint request

> **Note:** Enabling this setting makes the mint incompatible with wallets that do not support NUT-19

[00]: 00.md
[06]: 06.md
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if the required flag should be set by specific NUT. For BOLT12 and Onchain NUTs it will be a MUST as it is already specified in the PRs for those but I don't think this should break wallets that don't implement it for NUT-04.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think we can remove the required flag here. Leaving it up to wallets to choose to use it or not for NUT04 and future nuts that want to require it (eg bolt12) can specify that there.

Copy link
Contributor

@callebtc callebtc left a comment

Choose a reason for hiding this comment

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

LGTM

@callebtc callebtc added the ready Ready to merge label Dec 4, 2024
@thesimplekid
Copy link
Collaborator Author

ACK cccbb1d

error_codes.md Outdated Show resolved Hide resolved
error_codes.md Outdated Show resolved Hide resolved
error_codes.md Outdated Show resolved Hide resolved
@@ -16,6 +16,8 @@
| 20005 | Quote is pending | [NUT-04][04], [NUT-05][05] |
| 20006 | Invoice already paid | [NUT-05][05] |
| 20007 | Quote is expired | [NUT-04][04], [NUT-05][05] |
| 20008 | Signature for mint request invalid | [NUT-20][20] |
| 20009 | Pubkey required for mint quote | [NUT-20][20] |
Copy link
Contributor

@lollerfirst lollerfirst Dec 7, 2024

Choose a reason for hiding this comment

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

Is this error still necessary?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will be used for BOLT12 and onchain

Comment on lines -27 to +29
"description": <str|null>
"description": <str> // Optional
Copy link
Contributor

Choose a reason for hiding this comment

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

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 ready Ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants