what would be the minimum screen size to display lightning invoices as a qr-code?

For the Raspberry Pi Zero I found these displays:

  • 128x128 pixel LCD display (1.44 inch)
  • 200x200 pixel e-paper/e-Ink display (1.54 inch)
  • 128x64 pixel OLED display (0.96 inch)

I saw the examples in BOLT#11 and know that it depends on the input type and error correction setting when creating the qr-code.

Would the qr-code be readable if every black dot of the qr-code would be respresented with only one dot? Or do I need for example 4 dots, resulting in a 32x32 qr-code? Would that be enough for lightning invoices? Is it possible to convert the lightning invoice in all uppercase for generating the qr-code in alphanumeric mode which only uses 5.5 bits per character instead of 8?

With the Google Charts API it is possible to generate QR-Codes, this link generates a QR-Code with 128x128 pixel with the first example invoice from BOLT#11 and an error correction of M (allows recovery of up to 15% data loss): https://chart.googleapis.com/chart?cht=qr&chl=lnbc1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdpl2pkx2ctnv5sxxmmwwd5kgetjypeh2ursdae8g6twvus8g6rfwvs8qun0dfjkxaq8rkx3yf5tcsyz3d73gafnh3cax9rn449d9p5uxz9ezhhypd0elx87sjle52x86fux2ypatgddc6k63n7erqz25le42c4u4ecky03ylcqca784w&chs=128x128&chld=M|0


First of all yes it is possible to convert all characters to uppercase a trick some users of lightning already use.

If you look in the lightning rfc you can see that the length of an invoice can become quite large as the discriptions, routing hints and fallback addresses are not fixed I think there is not even an upper limit defined. For example this test invoice has 439 characters.


QR Codes themselves come at different versions which define how much data can be stored in them depending on how many pixels are used.

What I can't tell u if one pixel of a display would be sufficient. I guess even with error correction this would not be enough. For example the RaspiBlitz uses a 320 * 480 display


Just stumbled upon the answer to this on Twitter myself: https://twitter.com/sakak_musdom/status/1084857547947880448

So the 128x64 pixel OLED display (0.96 inch) is apparently enough to display a lightning invoice.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.