WIP: NUT-XX: Animated QR codes #31

Closed
gandlafbtc wants to merge 2 commits from animated-qr into main
gandlafbtc commented 2023-06-16 07:47:05 +00:00 (Migrated from github.com)

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.

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](https://github.com/gre/qrloop) . 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 commented 2023-06-16 16:00:25 +00:00 (Migrated from github.com)

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.

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!

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](https://github.com/BlockchainCommons). They have a standard called [UR (unified resource)](https://github.com/BlockchainCommons/crypto-commons) used by [more and more wallets](https://github.com/BlockchainCommons/Gordian-Developer-Community/blob/master/README.md#urs) 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](https://www.blockchaincommons.com/devs/animated-qrs.html) which has implementations in [some popular languages](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-005-ur.md#implementations). 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](https://github.com/BlockchainCommons/crypto-commons#bc-ur)], [[page 2](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-005-ur.md#implementations)] **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!
thunderbiscuit commented 2024-01-24 11:57:03 +00:00 (Migrated from github.com)

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.

Blockchain Commons has released an implementation guide for the fountain code standard, [and it's here](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2024-001-multipart-ur.md). I'm about halfway done building a library [here](https://github.com/kotlin-bitcoin-tools/ur), but you can find working implementations in TS/JS/Java/Swift [here](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-005-ur.md#implementations).
gandlafbtc commented 2024-02-28 13:43:55 +00:00 (Migrated from github.com)

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 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 commented 2024-02-28 15:04:33 +00:00 (Migrated from github.com)

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?

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](https://bbqr.org/) 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 commented 2024-02-29 04:04:15 +00:00 (Migrated from github.com)

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

Not even sure if other options are "technically better". I think what BC UR does fits cashus usecase pretty well.
callebtc commented 2024-03-19 10:06:43 +00:00 (Migrated from github.com)

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.

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 commented 2024-05-11 16:48:57 +00:00 (Migrated from github.com)

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?

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?

Pull request closed

Sign in to join this conversation.
No description provided.