Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NUT-00: CBOR-encoded TokenV4 #109

Merged
merged 6 commits into from
Jul 9, 2024
Merged

NUT-00: CBOR-encoded TokenV4 #109

merged 6 commits into from
Jul 9, 2024

Conversation

callebtc
Copy link
Contributor

@callebtc callebtc commented Apr 5, 2024

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 cashubtc/nutshell#502

Todo:

  • example and test cases

00.md Outdated Show resolved Hide resolved
00.md Outdated
Comment on lines 238 to 242
When serialized, a TokenV4 looks like this:

```
cashuBoWF0gaJhbXVodHRwOi8vbG9jYWxob3N0OjMzMzhhcIKkYWlIAIiC2b1wghxhYQJhc3hAMGY5OTJmYmNmZjQ1MGI2YzJmNWNiYWMwMmQ2OWE4ZDUwOGIwOTEyYzEwZTI1NDVlYmEyZGVmNTU0M2FhNDVlMWFjWCECWAksUObH-oRm-Oa1whlFLElCyz5i_r1zyC1etH_Kmc6kYWlIAIiC2b1wghxhYQhhc3hAYTg5NGZjNDljZWYxMmM3MGFjMDhhZmQ2YTRkZTY4ZmQ2M2JiOWJjYmY5MzAyZTc3OTdiZTQ1ZDc2MGNiOGFmY2FjWCEC4rg3LKRNqFEtqV-xqtqX2WypEzSFhDAd7WHdiSQsZ6c=
```
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be nice to give the same token in v3 encoding, as a size comparison and also as a test case

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll work on this!

00.md Show resolved Hide resolved
@callebtc callebtc marked this pull request as ready for review April 19, 2024 10:32
Copy link
Collaborator

@thesimplekid thesimplekid left a comment

Choose a reason for hiding this comment

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

LGTM, maybe just add a test vector for it

@callebtc callebtc changed the title WIP: add TokenV4 [WIP] NUT-00: CBOR-encoded TokenV4 May 11, 2024
@callebtc callebtc added the wallet-only A change that affects only wallets label May 11, 2024
00.md Outdated Show resolved Hide resolved
00.md Outdated Show resolved Hide resolved
Co-authored-by: elnosh <elnosh@pm.me>
@callebtc callebtc changed the title [WIP] NUT-00: CBOR-encoded TokenV4 NUT-00: CBOR-encoded TokenV4 Jun 30, 2024
@callebtc callebtc added the ready Ready to merge label Jun 30, 2024
@callebtc
Copy link
Contributor Author

Done ed29eb2

Copy link
Collaborator

@thesimplekid thesimplekid left a comment

Choose a reason for hiding this comment

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

ACK d9b5499

@callebtc callebtc merged commit 7628a38 into main Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready Ready to merge wallet-only A change that affects only wallets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants