feat: Add NUT-XX Payment Request Bech32m Encoding specification#294
Merged
callebtc merged 23 commits intocashubtc:mainfrom Jan 11, 2026
Merged
feat: Add NUT-XX Payment Request Bech32m Encoding specification#294callebtc merged 23 commits intocashubtc:mainfrom
callebtc merged 23 commits intocashubtc:mainfrom
Conversation
72d7088 to
cb418b1
Compare
a1denvalu3
reviewed
Oct 13, 2025
Collaborator
Author
|
cdk updated to use it here cashubtc/cdk@5388c28 |
Egge21M
suggested changes
Dec 18, 2025
Egge21M
reviewed
Dec 18, 2025
Egge21M
reviewed
Dec 18, 2025
Egge21M
suggested changes
Dec 18, 2025
Add comprehensive specification for encoding Cashu payment requests using Bech32m format with TLV (Tag-Length-Value) serialization as an alternative to the existing CBOR+base64 format defined in NUT-18. - New specification file: 26.md defining NUT-26 - Updated README.md to include NUT-26 in the specification table The new Bech32m encoding format addresses several limitations of the legacy creqA (CBOR+base64) format: 1. **QR Code Efficiency**: Bech32m uppercase encoding is alphanumeric-mode compatible, resulting in 30-60% smaller QR codes 2. **Better Error Detection**: Built-in Bech32m checksums provide data integrity validation 3. **Improved Human Readability**: Clear `creqb1` prefix identifies the format 4. **Standards Alignment**: Consistent with Bitcoin addresses (BIP-173/350) and Lightning invoices - TLV-based serialization for flexible extensibility - Support for all NUT-18 payment request fields (id, amount, unit, mints, description, transports, NUT-10 conditions) - Compact encoding for common values (e.g., 'sat' as 0x00) - Nested TLV structures for complex types (transports, spending conditions) - Forward compatibility through unknown tag handling - Backward compatibility with legacy creqA format detection - Case-insensitive decoding with uppercase recommended for QR codes The specification is marked as optional and depends on NUT-18.
Co-authored-by: lollerfirst <43107113+lollerfirst@users.noreply.github.com>
Co-authored-by: lollerfirst <43107113+lollerfirst@users.noreply.github.com>
Co-authored-by: lollerfirst <43107113+lollerfirst@users.noreply.github.com>
23ece71 to
6651459
Compare
Contributor
|
Fully implemented in cashubtc/cashu-ts#436 |
5 tasks
Contributor
|
We are missing a signal for P2BK as @robwoodgate mentioned here: cashubtc/cashu-ts#436 (review) |
Contributor
Wondering if some kind of general "tag" is possible that allows extension of the TLV schema without having to redefine it each time? I think this is what TSK was talking about on the p2bk nut pr? |
Egge21M
approved these changes
Jan 6, 2026
robwoodgate
approved these changes
Jan 6, 2026
Contributor
There was a problem hiding this comment.
We can "extend" to cater for extras like P2BK later. This is a solid base.
ACK @ a96323a
Contributor
|
This has been finalized and implemented for three weeks. No NACKs remain. I think this should be merged, but my green dont count. @callebtc |
callebtc
approved these changes
Jan 11, 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.
Add comprehensive specification for encoding Cashu payment requests using Bech32m format with TLV (Tag-Length-Value) serialization as an alternative to the existing CBOR+base64 format defined in NUT-18.
The new Bech32m encoding format addresses several limitations of the legacy creqA (CBOR+base64) format:
creqb1prefix identifies the formatThe specification is marked as optional and depends on NUT-18.