No description
  • Python 52.6%
  • HTML 36.5%
  • JavaScript 10%
  • Makefile 0.9%
Find a file
Padreug 9c0e58a87c
Some checks failed
lint.yml / feat: merge a link's `extra` into the payout payment (v1.2.2-aio.2) (pull_request) Failing after 0s
lint.yml / feat: merge a link's `extra` into the payout payment (v1.2.2-aio.2) (push) Failing after 0s
feat: merge a link's extra into the payout payment (v1.2.2-aio.2)
Adds an optional `extra` (JSON) field to a withdraw link. When the link
is claimed, that `extra` is merged onto the payout payment's `extra`, so
a caller can tag the resulting payment with metadata an external listener
keys on — the link is the only place to attach it (the customer-facing
LNURL-withdraw payout otherwise carries just `{tag, withdrawal_link_id}`).

Motivating use: bitSpire cash-in settlements. The operator's spirekeeper
listener fires a `cash_in` settlement (fee split to the platform) only on
an outbound payment stamped `source=bitspire`; before this there was no
way to stamp an LNURL-withdraw payout, so cash-ins never settled. bitSpire
now creates the cash-in link for the NET amount with
`extra={source, type:cash_in, principal_sats, fee_sats, ...}` and the
settlement fires on claim.

- models: `extra: dict | None` on CreateWithdrawData + WithdrawLink.
  LNbits' db layer (de)serializes dict columns to/from JSON natively
  (same as Payment.extra) — no per-field validator needed.
- migrations_fork.py: `withdraw_link.extra TEXT` under `withdraw_fork`,
  keeping the upstream-tracked migrations.py byte-identical for clean
  rebases (aiolabs/lnbits#8 pattern).
- views_lnurl: `extra={**(link.extra or {}), "tag": ..., "withdrawal_link_id": ...}`
  — the withdraw extension's own keys are written last so a caller cannot
  clobber them.

Verified end-to-end on the dev stack: a stamped link's payout carries the
merged extra and drives a spirekeeper cash_in settlement + super-fee payout.
2026-06-21 17:26:14 +02:00
.github/workflows feat: update to uv (#59) 2025-08-24 23:10:31 +02:00
static feat: add disable option for LNURLw (#70) 2026-03-17 21:41:17 +00:00
templates/withdraw feat: add disable option for LNURLw (#70) 2026-03-17 21:41:17 +00:00
tests Revert "fix: allow HTTP LNURL for RFC1918/loopback baseurls (#2)" 2026-06-01 21:44:57 +02:00
.gitignore feat: add linters and ci (#28) 2024-07-11 10:30:28 +02:00
.pre-commit-config.yaml feat: add linters and ci (#28) 2024-07-11 10:30:28 +02:00
.prettierrc feat: add linters and ci (#28) 2024-07-11 10:30:28 +02:00
__init__.py feat: lnurlw_list_links + lnurlw_unique_hashes transport RPCs 2026-05-13 09:45:40 +02:00
config.json feat: merge a link's extra into the payout payment (v1.2.2-aio.2) 2026-06-21 17:26:14 +02:00
crud.py feat: merge a link's extra into the payout payment (v1.2.2-aio.2) 2026-06-21 17:26:14 +02:00
description.md feat: add linters and ci (#28) 2024-07-11 10:30:28 +02:00
helpers.py Revert "fix: allow HTTP LNURL for RFC1918/loopback baseurls (#2)" 2026-06-01 21:44:57 +02:00
LICENSE add license 2023-02-24 18:13:41 +01:00
Makefile feat: update to uv (#59) 2025-08-24 23:10:31 +02:00
manifest.json feat: add linters and ci (#28) 2024-07-11 10:30:28 +02:00
migrations.py feat: add disable option for LNURLw (#70) 2026-03-17 21:41:17 +00:00
migrations_fork.py feat: merge a link's extra into the payout payment (v1.2.2-aio.2) 2026-06-21 17:26:14 +02:00
models.py feat: merge a link's extra into the payout payment (v1.2.2-aio.2) 2026-06-21 17:26:14 +02:00
package-lock.json feat: add linters and ci (#28) 2024-07-11 10:30:28 +02:00
package.json feat: add linters and ci (#28) 2024-07-11 10:30:28 +02:00
pyproject.toml fix: print qr code (#62) 2025-09-12 14:26:18 +01:00
README.md feat: add linters and ci (#28) 2024-07-11 10:30:28 +02:00
toc.md feat: add linters and ci (#28) 2024-07-11 10:30:28 +02:00
transport_rpcs.py Revert "fix: allow HTTP LNURL for RFC1918/loopback baseurls (#2)" 2026-06-01 21:44:57 +02:00
uv.lock feat: update to uv (#59) 2025-08-24 23:10:31 +02:00
views.py feat: add disable option for LNURLw (#70) 2026-03-17 21:41:17 +00:00
views_api.py FIX: generate LNURL server-side for unique voucher links (#68) 2025-12-27 09:45:57 +01:00
views_lnurl.py feat: merge a link's extra into the payout payment (v1.2.2-aio.2) 2026-06-21 17:26:14 +02:00

LNURLw - LNbits extension

For more about LNBits extension check this tutorial

Create a static QR code people can use to withdraw funds from a Lightning Network wallet

LNURL is a range of lightning-network standards that allow us to use lightning-network differently. An LNURL withdraw is the permission for someone to pull a certain amount of funds from a lightning wallet.

The most common use case for an LNURL withdraw is a faucet, although it is a very powerful technology, with much further reaching implications. For example, an LNURL withdraw could be minted to pay for a subscription service. Or you can have a LNURLw as an offline Lightning wallet (a pre paid "card"), you use to pay for something without having to even reach your smartphone.

LNURL withdraw is a very powerful tool and should not have his use limited to just faucet applications. With LNURL withdraw, you have the ability to give someone the right to spend a range, once or multiple times. This functionality has not existed in money before.

Wallets supporting LNURL

Usage

Quick Vouchers

LNbits Quick Vouchers allows you to easily create a batch of LNURLw's QR codes that you can print and distribute as rewards, onboarding people into Lightning Network, gifts, etc...

  1. Create Quick Vouchers
    quick vouchers
    • select wallet
    • set the amount each voucher will allow someone to withdraw
    • set the amount of vouchers you want to create - have in mind you need to have a balance on the wallet that supports the amount * number of vouchers
  2. You can now print, share, display your LNURLw links or QR codes
    lnurlw created
    • on details you can print the vouchers
      printable vouchers
    • every printed LNURLw QR code is unique, it can only be used once
  3. Bonus: you can use an LNbits themed voucher, or use a custom one. There's a template.svg file in static/images folder if you want to create your own.
    voucher

Advanced

  1. Create the Advanced LNURLw
    create advanced lnurlw
    • set the wallet
    • set a title for the LNURLw (it will show up in users wallet)
    • define the minimum and maximum a user can withdraw, if you want a fixed amount set them both to an equal value
    • set how many times can the LNURLw be scanned, if it's a one time use or it can be scanned 100 times
    • LNbits has the "Time between withdraws" setting, you can define how long the LNURLw will be unavailable between scans
    • you can set the time in seconds, minutes or hours
    • the "Use unique withdraw QR..." reduces the chance of your LNURL withdraw being exploited and depleted by one person, by generating a new QR code every time it's scanned
  2. Print, share or display your LNURLw link or it's QR code
    lnurlw created

LNbits bonus: If a user doesn't have a Lightning Network wallet and scans the LNURLw QR code with their smartphone camera, or a QR scanner app, they can follow the link provided to claim their satoshis and get an instant LNbits wallet!