bech32-optimized QR codes #12191

issue Sjors opened this issue on January 15, 2018
  1. Sjors commented at 1:52 PM on January 15, 2018: member

    @sipa said in #11991:

    I haven't looked at the code, but inside QR codes it's advantageous to use uppercase Bech32 (it will result in a smaller QR encoding).

    Is that still the case when rendered as URI?

    Should amounts be added in a different way?

    Would that involve amending BIP-21?

  2. sipa commented at 1:54 PM on January 15, 2018: member

    Bech32 addresses are valid both in all-lowercase or all-uppercase, so even inside a URI you can use the uppercase version (though the bitcoin: locator should remain lowercase).

  3. Sjors commented at 2:02 PM on January 15, 2018: member

    But wasn't there a more efficient but not BIP-21 compliant way to encode amounts?

  4. sipa commented at 2:18 PM on January 15, 2018: member

    No clue. All you need to get the better efficiency in QR is sequences of several characters of uppercase+digits in a row. It doesn't require everything to be uppercase.

  5. fanquake added the label GUI on Jan 18, 2018
  6. hebasto commented at 10:18 AM on April 22, 2019: member

    @sipa

    No clue. All you need to get the better efficiency in QR is sequences of several characters of uppercase+digits in a row. It doesn't require everything to be uppercase.

    ~That is not the case. For better efficiency with alphanumeric character encoding all symbols must belongs to the set 0..9, A..Z, %, *, +, -, ., /, :.~

    Ref: https://en.wikipedia.org/wiki/QR_code#Encoding

  7. sipa commented at 4:00 PM on April 22, 2019: member

    @hebasto My understanding is that QR codes encode a sequence of groups, where each group has a single encoding, and a variable number of characters. As long as there are sufficient numbers of characters to emit a separate group, libqrencode will use it.

  8. sipa commented at 4:21 PM on April 22, 2019: member

    @hebasto From the wikipedia article:

    Encoding modes can be mixed as needed within a QR symbol. (e.g., a url with a long string of alphanumeric characters )
  9. hebasto commented at 6:37 PM on April 22, 2019: member

    @sipa TIL, thank you.

  10. jonasschnelli closed this on Apr 29, 2019

  11. jonasschnelli referenced this in commit 3a0d6da098 on Apr 29, 2019
  12. MarcoFalke locked this on Dec 16, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-14 09:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me