NUT-00: CBOR-encoded TokenV4 #109
No reviewers
Labels
No labels
breaking change
bug
documentation
enhancement
needs discussion
needs implementation
new nut
ready
wallet-only
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo-admin/nuts!109
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "tokenv4_cbor"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR proposes a new TokenV4 binary encoding format using CBOR that reduces token size by around 40%.
It is implemented as a WIP and POC in https://github.com/cashubtc/nutshell/pull/502
Todo:
Should the secret be of type
bytes?The secret is a UTF-8 encoded string, so converting it to bytes doesn't save space in this case (in my tests with CBOR).
Would be nice to give the same token in v3 encoding, as a size comparison and also as a test case
@ -199,0 +272,4 @@{"i": h'00ad268c4d1f5826',"p": [{Nit: When compressing keys to a single char, if possible it's nice to have no collisions to avoid confusion, and also makes expanding to readable names trivial with a dict (no context needed). Here it's only
"m"and"s"that can have two meanings"m"formemobecomes"o"(memO)"s"in DLEQ could be something else, not sure what it stands for... could be"g"from siGnature (I think it's a Schnorr sig along withe?), though that may be confused with theggenerator point, so it could also be"p"from resPonse@ -199,0 +272,4 @@{"i": h'00ad268c4d1f5826',"p": [{In my view, I think it's fine that labels are duplicated since this object isn't meant for human consumption anyway...
I'll work on this!
LGTM, maybe just add a test vector for it
Following some discussion in other channels. I think its best to remove the support for mulimint tokens in V4. It adds unnecessary complexity to the token.
should it say that the DLEQ field is optional?
Agreed! Please feel free to commit to the PR or suggest a change!
Done ed29eb2
ACK
d9b5499a70