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

On chain mint and melt #194

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

thesimplekid
Copy link
Collaborator

Depends on #188

  • CDK
  • Nutshell
  • Nutmix
  • goNuts
  • cashu-ts

Supersedes #107

@thesimplekid thesimplekid added the new nut A new protocol NUT label Nov 21, 2024
{
"amount": <int>,
"unit": <str_enum["sat"]>,
"pubkey": <str>
Copy link
Contributor

Choose a reason for hiding this comment

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

NUT-19 says this should be optional, depending on whether or not the MintInfo requires it.

{
"quote": <str>,
"outputs": <Array[BlindedMessage]>,
"witness": <str>
Copy link
Contributor

Choose a reason for hiding this comment

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

Here as well. It's not clear if this NUT requires a Mint that requires NUT-19 signatures or only supports them.

@lollerfirst
Copy link
Contributor

lollerfirst commented Nov 23, 2024

@thesimplekid Why do we need new NUTs for this? Can't we just add some appendices to NUT-3, NUT-4 and NUT-5 on what additional fields a particular Post{Mint|Melt}OnchainRequest should have?

We can then modify NUT-6 to include information about a particular minting and melting method called btconchain like this:

"nuts": {
    "4": {
      "methods": [
        {
          "method": "bolt11",
          "unit": "sat",
          "min_amount": 0,
          "max_amount": 10000
        },
        {
          "method": "btconchain",
          "unit": "sat",
          "min_amount": 0,
          "max_amount": 10000,
          "min_confirmations": 3,
        }
      ],
      "disabled": false
    },
    "5": {
      "methods": [
        {
          "method": "bolt11",
          "unit": "sat",
          "min_amount": 100,
          "max_amount": 10000
        },
        {
          "method": "btconchain",
          "unit": "sat",
          "min_amount": 0,
          "max_amount": 10000
        }
      ],
      "disabled": false
    },
    ...
  }

@thesimplekid
Copy link
Collaborator Author

@thesimplekid Why do we need new NUTs for this? Can't we just add some appendices to NUT-3, NUT-4 and NUT-5 on what additional fields a particular Post{Mint|Melt}OnchainRequest should have?

We can then modify NUT-6 to include information about a particular minting and melting method called btconchain like this:

I think its a reasonable question, and one way to do it. But I don't really think we should be changing or adding to past nuts. I think it gets confusing, its better to just have new nuts. That being said maybe what id defined in the new nuts could be reduced and and reference the existing nuts and some of it is repetitive. Though I did it this way because this way the nut stands more on its own and you don't have to check another nut as much. But think there are arguments for and against that

@prusnak
Copy link
Collaborator

prusnak commented Nov 24, 2024

NUTs 3, 4 and 5 are mandatory. Adding optional fields to them feels wrong.

Also on-chain minting has some specifics (and we already see that via quote locking) and therefore I think this deserves another pair of NUTs.

I would like to also see Liquid supported and I feel this should be again another pair of NUTs, although the distinction here is probably not that strong and Liquid support can become a part of the BTC on-chain NUTs.

```json
{
"quote": <str>,
"address": <str>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"address": <str>,
"request": <str>,

since in other places throughout this NUT request is being used rather than address

Comment on lines +101 to +103
### Witness

In order to mint ecash the wallet **MUST** include a signature as defined in [NUT-19][19].
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be moved to the Minting tokens section where this field is used in the request.

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.

4 participants