Skip to content

nut10: Add witness section and warning - #359

Open
robwoodgate wants to merge 2 commits into
cashubtc:mainfrom
robwoodgate:witness-rejection
Open

nut10: Add witness section and warning#359
robwoodgate wants to merge 2 commits into
cashubtc:mainfrom
robwoodgate:witness-rejection

Conversation

@robwoodgate

@robwoodgate robwoodgate commented Apr 2, 2026

Copy link
Copy Markdown
Collaborator

Mints currently treat Proofs with a witness field but a plain (non-NUT-10) secret differently.

Nutshell rejects, CDK ignores the witness.

This PR codifies this behavior with a warning.

@github-project-automation github-project-automation Bot moved this to Backlog in nuts Apr 2, 2026
@robwoodgate

Copy link
Copy Markdown
Collaborator Author

@ye0man - This PR still highlights a real problem, but this far down the road, I think the real solution is to tweak Nutshell to ignore witnesses it doesn't need (follow CDK).

With keysets v3 on the horizon, there will be plenty of non-NUT10 shaped secrets that DO require a witness so the comment, as written, will age badly.

@KvngMikey

Copy link
Copy Markdown
Member

With the proposal for Nutshell to adapt CDK's behavior (ignore witnesses it doesn't need), I think the normative text in this PR should flip from "MAY reject" to "SHOULD ignore":

Proof.witness is only expected for proofs containing a NUT-10 Well-known Secret.
A mint SHOULD ignore a witness field on a Proof whose secret cannot be parsed as a Well-known Secret.

Worth keeping/adding alongside this:

  • Mints SHOULD still reject malformed JSON secrets that declare a NUT-10 shape or known kind (genuine malformedness, not plainness).
  • Mints MUST still reject plain secrets inside SIG_ALL batches, where every input must be a spending condition.
  • Optionally: mints MAY log when they drop a witness on a plain secret, so the behavior is observable without being a hard failure.

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