Skip to content

Specify NUT-22 authA serialization#353

Merged
thesimplekid merged 2 commits intocashubtc:mainfrom
robwoodgate:nut-22-autha
Mar 21, 2026
Merged

Specify NUT-22 authA serialization#353
thesimplekid merged 2 commits intocashubtc:mainfrom
robwoodgate:nut-22-autha

Conversation

@robwoodgate
Copy link
Contributor

@robwoodgate robwoodgate commented Mar 16, 2026

NUT-22 does not specify the base64 encoding variant to use.

CDK uses general_purpose::URL_SAFE, which requires base64 URL with padding .

This PR requires mints to support both padded and unpadded forms (as per #147).

Implementation

NOTE: This was not an issue prior to keysets v2, as keyset v1 IDs (16 chars) produced serialized BAT JSON of exactly 174 bytes, and 174 % 3 = 0 — so base64 encoding never produced any padding before.

@thesimplekid
Copy link
Collaborator

@robwoodgate looks like what I told you was wrong. We did not restrict the spec for the normal tokens. So I think we should do the same here and cdk should be changed to be less restrictive.

#147

@robwoodgate
Copy link
Contributor Author

@robwoodgate looks like what I told you was wrong. We did not restrict the spec for the normal tokens. So I think we should do the same here and cdk should be changed to be less restrictive.

#147

@thesimplekid - that is even better. I've tweaked the spec to say mints MUST support both forms.

I'll leave Cashu-TS on padded, as that is backwards compatible with CDK <= 0.15.2

Please can you raise a ticket to sort CDK and pop it on this PR when ready.

@thesimplekid thesimplekid merged commit e06fa23 into cashubtc:main Mar 21, 2026
1 check passed
@github-project-automation github-project-automation bot moved this from Backlog to Done in nuts Mar 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants