-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
NUT-XX: Animated QR codes #31
Conversation
Love the animated QRs. I've been looking into them for the bitcoin development kit mobile bindings for a little while and figured I'd share some thoughts. The most prominent and well-developed "maybe-standard?" for them is developed by Blockchain Commons. They have a standard called UR (unified resource) used by more and more wallets which is basically using CBOR to encode wallet-related data (PSBTs, keys, others, etc.). Building on this, they have defined a standard for animated QR codes which has implementations in some popular languages. Their docs are very thorough but all over the place; you have to dig in to find related pages. Some extra linksImplementations: [page 1], [page 2] The pros of going with an approach like this is that you'll likely find libraries that implement that encoding and decoding (good for interop) and not require all Cashu wallets implement a new standard. The con is that this particular standard is fairly complex and will require time/effort to bring everyone up to speed. It is a very good sign that other bitcoin wallets all over the place are using it however, and probably a strong foundation to build on. Hopefully this can add to the discussion and shed light on tradeoffs. Cheers! |
Blockchain Commons has released an implementation guide for the fountain code standard, and it's here. I'm about halfway done building a library here, but you can find working implementations in TS/JS/Java/Swift here. |
i tweaked the typescript implementation of bc-ur here https://github.com/gandlafbtc/bc-ur to make it work in the browser. Obviously blockchain commons UR is superior in every way. I changed The nut-number, and added some basic text for the NUT |
I agree using UR for animated makes sense, afaik it has the most existing implementations among Bitcoin wallets so is the de-facto standard at the moment, and probably be most familiar to devs. Ofc there's BBQR or qrloop and probably other options, but the same spirit of "JSON will work for now" should push towards UR vs the other 'technically better' options? |
Not even sure if other options are "technically better". I think what BC UR does fits cashus usecase pretty well. |
I've recently implemented UR in cashu.me using gandlaf's awesome library It was very easy to add and felt a bit like magic because it just works. |
We should pick up this PR again, I think the document can be extremely short since there is a canonical way of how to produce bc-ur animated QR codes and we already have a cross-compatible implementation in cashu.me and nutshell. @gandlafbtc, what do you think? |
Ok this is a draft for the animated QR codes.
It is certainly not the most (byte wise) efficient solution, but it is easy to implement and that was the basis for the design choices. If efficiency is the more important, we could lean more towards what is done here . In my opinion, keeping it simple and easy to include into all kind of libs/apps outweigh the efficiency gains we would get from that though.
Let me know what you guys think.