Documentation
QR images and Polar
Get an invoice, turn it into a QR, and import it into either client.
Step 01
Get an invoice from Polar
Open the terminal for a running LND node in Polar. List that node’s invoices:
lncli --network=regtest listinvoicesCopy a complete payment_request value. To create a fresh demo invoice for 1,000 sats:
lncli --network=regtest addinvoice --amt 1000 --memo "Decoder demo"These commands run inside the Polar node terminal, not the decoder’s terminal.
Step 02
Generate a QR image
Back in your project’s local terminal, replace the placeholder with that invoice. Keep the quotes.
cargo run -p lightning-cli --example sample_qr -- 'PASTE_COMPLETE_INVOICE_HERE' my-invoice.pngThis creates a PNG containing the invoice, with a lightning: prefix. Choose a new output filename if the file already exists. Encoding a QR does not create a new invoice or change its expiry.
Step 03
Import the QR
In the web app, choose or drop an image, review the extracted text, and select Decode invoice. In Ratatui, press F3 and enter the local image path.
Both clients support PNG, JPEG, and WebP up to 10 MB. The browser allows up to 16 million pixels; the terminal limits dimensions to 4096 × 4096. Use one QR per image.
A wallet’s BOLT11 invoice QR works too. Lightning address, LNURL, and BOLT12 offer QR codes are not currently supported as invoice input.
Step 04
Use the bundled samples
Find the coffee and donation images in frontend/public/samples/. Regenerate them with:
cargo run -p lightning-cli --example sample_qrThese public sample invoices are expired and intended for inspection.