Specify NUT-22 authA serialization#353
Merged
thesimplekid merged 2 commits intocashubtc:mainfrom Mar 21, 2026
Merged
Conversation
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. |
Contributor
Author
@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
approved these changes
Mar 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.