Cashu question: What’s the difference between the “legacy” format (cashuA…) and the “new” version (cashuB…) in nostr:npub1h2qfjpnxau9k7ja9qkf50043xfpfy8j5v60xsqryef64y44puwnq28w8ch? I noticed it when trying to claim tokens with nostr:npub1cashuq3y9av98ljm2y75z8cek39d8ux6jk3g6vafkl5j0uj4m5ks378fhq, which only accepts the legacy one.

#AskNostr #DeezNuts 🌰🐿️

Reply to this note

Please Login to reply.

Discussion

The legacy format v3 encodes the JSON with base64_urlsafe with the prefix cashuA.

The v4 format uses smaller JSON keys and adds CBOR (converts the JSON to binary) then encodes as base64_urlsafe with the prefix cashuB.

This results in smaller sized tokens.

The prefix was my suggestion to make the difference both human and machine readable, iirc.

CC nostr:nprofile1qqs9pk20ctv9srrg9vr354p03v0rrgsqkpggh2u45va77zz4mu5p6ccpz4mhxue69uhhyetvv9ujuerpd46hxtnfduhsz9thwden5te0dehhxarj9ehhsarj9ejx2a30qyg8wumn8ghj7mn0wd68ytnddakj7xph5zr

For more info:

https://github.com/cashubtc/nuts/blob/main/00.md

I see what you mean — quite a difference in length!

Nice! Support for the cashuB format is in the pipeline too. 😎

SOON™