TIL that cashu tokens are base64-encoded JSON.

WTF people. Have you never heard of binary serialization? No wonder cashu has such huge, hard to scan, QR codes.

Reply to this note

Please Login to reply.

Discussion

Somewhat for the same reason NOSTR is JSON not a smaller binary packing, because JSON is near universally usable, even if pretty crap

Low dev effort to get started using a thing is important, perfect enemy of good

This is financial crypto we're talking about. If you can't decode some binary serialization you shouldn't be working on it.

GM

Yeah we didn't optimize for size *at all* yet. Token encoding is purely client-side, cashuA... is base64, cashuB... will be binary.

Btw, you're the first person I've ever seen who managed to get a triple-nut token scanned. Since the problem can't be solved generally, the real solution is animated fountain QR codes.

Classic Bitcoin core dev mindset

can be good but it's led to all kinds of really stupid mistakes:

- bech32 (broken) and bech32m (the fix) imo both worse than satoshis original base58

- xonly pubkeys

- segwit (we can just prune signatures lol)

- there's probably more

nostr:nevent1qqs9qjg240dh2kr6c7yyqed7fjgzde4lchjw87q573juv0kljym9dqqpz3mhxue69uhhyetvv9ujuerpd46hxtnfdupzpn92tr3hexwgt0z7w4qz3fcch4ryshja8jeng453aj4c83646jxvqvzqqqqqqyxwjgtf

Cashu v2 would be nice, incorporating lessons learned so far

Pfff... how inefficient :D

{

"content": "TIL that cashu tokens are base64-encoded JSON.\n\nWTF people. Have you never heard of binary serialization? No wonder cashu has such huge, hard to scan, QR codes.",

"created_at": 1700564822,

"id": "50490aabdb75587ac7884065be4c9026e6bfc5e4e3f814f465c63edf91365680",

"kind": 1,

"pubkey": "ccaa58e37c99c85bc5e754028a718bd46485e5d3cb3345691ecab83c755d48cc",

"sig": "ea31e31d0de5de41d8e221d733b4e10e0a59c2bc0072b427edd6ad2e89627f1db938e65b698f4379ecbf50c15c5eb156f73de273a9caae70a74f530986d31e14",

"tags": []

}