Skip to content
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

Closed
wants to merge 2 commits into from
Closed

Conversation

gandlafbtc
Copy link
Collaborator

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.

@thunderbiscuit
Copy link
Collaborator

thunderbiscuit commented Jun 16, 2023

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 links

Implementations: [page 1], [page 2]
Spec: https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-005-ur.md
UR types (tokens would have to use bytes but could request a new type be added to the spec): https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-006-urtypes.md
Uniform Resource (UR) Specification section of the Projects page: https://www.blockchaincommons.com/projects.html#uniform-resource-ur-specification
Animated QRs section of the Projects page: https://www.blockchaincommons.com/projects.html#animated-qrs

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!

@callebtc callebtc marked this pull request as draft July 25, 2023 10:43
@thunderbiscuit
Copy link
Collaborator

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.

@gandlafbtc
Copy link
Collaborator Author

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

@AngusP
Copy link
Contributor

AngusP commented Feb 28, 2024

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?

@gandlafbtc
Copy link
Collaborator Author

Not even sure if other options are "technically better". I think what BC UR does fits cashus usecase pretty well.

@callebtc
Copy link
Contributor

I've recently implemented UR in cashu.me using gandlaf's awesome library @gandlaf21/bc-ur here: https://github.com/gandlafbtc/bc-ur

It was very easy to add and felt a bit like magic because it just works.

@callebtc callebtc changed the title draft for animated qr nut NUT-XX: Animated QR codes May 11, 2024
@callebtc callebtc added the enhancement New feature or request label May 11, 2024
@callebtc
Copy link
Contributor

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?

@callebtc callebtc added new nut A new protocol NUT needs discussion Needs more discussion wallet-only A change that affects only wallets labels May 11, 2024
@callebtc callebtc mentioned this pull request May 23, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request needs discussion Needs more discussion new nut A new protocol NUT wallet-only A change that affects only wallets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants