Skip to content

NUT-XX: replay-protect pubkey quote lookup signatures#391

Open
robwoodgate wants to merge 2 commits into
cashubtc:get-quotes-by-pubkeysfrom
robwoodgate:nut29-replay-protection
Open

NUT-XX: replay-protect pubkey quote lookup signatures#391
robwoodgate wants to merge 2 commits into
cashubtc:get-quotes-by-pubkeysfrom
robwoodgate:nut29-replay-protection

Conversation

@robwoodgate

@robwoodgate robwoodgate commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Intended to be merged into #341 as an amendment.

Problem

As written, the lookup signature is over the bare public key bytes. That message is static and over a value that is itself public, so the signature is a permanent bearer token: anyone who observes it once (mint logs, a TLS-terminating proxy, a MITM) can replay it forever to read that pubkey's quote history.

Change

The signature now commits to a fresh, mint-scoped message:

"Cashu_MintQuoteLookup_v1" || mint_pubkey || pubkey
  • mint_pubkey (from the NUT-06 info response) binds the signature to one mint, so it cannot be replayed against another mint. The mint pubkey is used rather than the mint URL to avoid URL canonicalization ambiguity. Mints supporting this NUT MUST advertise a pubkey.

@github-project-automation github-project-automation Bot moved this to Backlog in nuts Jun 18, 2026
@robwoodgate robwoodgate changed the title NUT-29: replay-protect pubkey quote lookup signatures NUT-XX: replay-protect pubkey quote lookup signatures Jun 18, 2026

@TheMhv TheMhv left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM!

ACK e799ab4

@a1denvalu3

Copy link
Copy Markdown
Contributor

nonce (random 16 bytes) dedups within that window, so the mint only retains nonces for max_age. No challenge round trip.

I think it's not worth it to add nonce. it would mean the Mint has to keep track of them and run background tasks to clear them etc... no. A timestamp, with a wide +/-10 minutes tolerance, is enough.

@robwoodgate

Copy link
Copy Markdown
Collaborator Author

nonce (random 16 bytes) dedups within that window, so the mint only retains nonces for max_age. No challenge round trip.

I think it's not worth it to add nonce. it would mean the Mint has to keep track of them and run background tasks to clear them etc... no. A timestamp, with a wide +/-10 minutes tolerance, is enough.

nonce is time bound by timestamp - it covers the replay protection concern within the time allocation.

The mint only needs to track nonces for max_age seconds. After that, the signature can't be replayed because of age. It removes the need for an extra call to the mint to get a nonce challenge (which the mint would ALSO have to track).

Removing it means we accept replay in the max_age window.

@robwoodgate

Copy link
Copy Markdown
Collaborator Author

PR updated following offline discussions. Nonce and timestamp now removed as agreed.

@callebtc - this should be ready to merge into #341, making it in ready for final review and NUT numbering.

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.

3 participants