Skip to content

NUT-06: require signed mint info - #416

Open
a1denvalu3 wants to merge 1 commit into
cashubtc:mainfrom
a1denvalu3:amend-nut-06-signed-mint-info
Open

NUT-06: require signed mint info#416
a1denvalu3 wants to merge 1 commit into
cashubtc:mainfrom
a1denvalu3:amend-nut-06-signed-mint-info

Conversation

@a1denvalu3

Copy link
Copy Markdown
Contributor

Summary

  • standardize derivation of the mint identity key from the mint seed
  • make the mint identity public key mandatory
  • require a BIP-340 Schnorr signature over the RFC 8785 canonicalized info response, excluding time and signature
  • require wallets to reject missing, malformed, or invalid signatures
  • add a reproducible, cryptographically verified example

Validation

  • npx prettier@3.9.1 --check 06.md
  • verified that the example public key derives from the documented seed and that its signature validates against the specified payload

Comment thread 06.md
The mint identity key is deterministically derived from the mint seed. Given the exact `seed` string used by the mint:

1. Encode `seed` as UTF-8.
2. Compute `secret_key = SHA256(seed)`.

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.

we should use HMAC-SHA256 construction like we do in other NUTS (e.g. 12 or 13)

Comment thread 06.md

1. Encode `seed` as UTF-8.
2. Compute `secret_key = SHA256(seed)`.
3. Interpret `secret_key` as a 32-byte big-endian integer. It **MUST** be a valid secp256k1 secret key in the range `1..n-1`, where `n` is the order of the secp256k1 curve.

@prusnak prusnak Jul 29, 2026

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.

What happens if it does not fit? Maybe introduce a counter to the HMAC above and retry with ctr = 1, 2, 3, etc.?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

probability it doesn't fit should be roughly $\frac{1}{2^{128}}$

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.

I know, but we use the same construction in NUT-12, see

nuts/12.md

Line 21 in e0a16f8

r = HMAC-SHA256(key=a, data="Cashu_DLEQ_R_v1" || A || B' || C' || ctr) # Deterministic nonce

nuts/12.md

Line 39 in e0a16f8

ctr = nonce counter byte; set to 0x00 initially, increment and retry if r == 0 or r >= n (max 256 tries)

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.

2 participants