-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize QR code #64
Comments
@robtex Yeah, I'm not too worried about wallet support for uppercasing. I think there's fairly wide support for it, actually. This data is from December 2020 but already has promising results. Wouldn't surprise me if some of these red Xs have become checkmarks in the past year and a half. btcpayserver/btcpayserver#2110 |
Ran some tests by generating QR codes with this tool. I decided to run this test with different variations, like changing number of URI params and changing the invoice. In every case, the uppercase QR is a lower-resolution image. These codes are being generated with the qrcode NPM library. This lib is supposed to automatically choose the correct QR code mode for you based on what's most efficient for the input string. I imagine it's selecting "mixed" for most of these, but regardless, it's supposed to be choosing the most size efficient mode. So I think this can serve as a proof of concept that the uppercasing can work very well. URI with label and messageBuild command
URI
URI with label and message (uppercase)Build command
URI
URI with label and message - alternate invoiceBuild command
URI
URI with label and message - alternate invoice (uppercase)Build command
URI
URI with amountBuild Command
URI
URI with amount (uppercase)Build Command
URI
URI with lightning param onlyBuild Command
URI
URI with lightning param only (uppercase)Build Command
URI
|
@robtex I'll make a PR to change the QR codes on the site as well as add some text to explain the value of uppercasing. |
I decided to do some investigation regarding the capitalizing the scheme and parameter, as well as changing from See data here. For each row, the green outlines indicate the smallest QR dimension (there are many ties per row). Orange outlines indicate the second smallest QR dimension (also many ties). My conclusion:
Personally, I'd rather spend time discussing BOLT12 than trying to save 16 pixels in some situations. |
Wow, thorough analysis there. Your recommendation makes sense to me. ACK. |
definitely exhaustive enough and also uppercase enough for me. very nice! |
Nice research, makes sense to me! A shame these iQR codes are proprietary: https://qrcode.meetheed.com/question40.php "You could take an iQR Code and a QR Code of exactly the same size, and encode a lot more data within the iQR Code (up to 80% more)." |
Thanks for pushing for this @robtex and others! Merged. |
by changing to uppercase a QR code only needs 5.5 bits instead of 8 bits
bech32 is designed to work in uppercase QR
the proposed strings are not 100% in the supported alphabet, but QR code has a mixed mode that means it can switch mode inside the same QR code
i suggest we simply uppercase the lightning invoice to start with, all wallets i know support uppercase lightning invoices.
bc1 on chain addresses should also be possible to uppercase in the same way since they are bech32
some wallets will probably have issues, but it is them that have to fix it.
small example, the example on https://bitcoinqr.dev/


only change is lightning invoice uppercased:
it is quite obvious that it needs fewer bits
The text was updated successfully, but these errors were encountered: