Git Product home page Git Product logo

lnurlp's Introduction

LNURLp - LNbits extension

For more about LNBits extension check this tutorial

Create a static QR code or LNaddress people can use to pay over Lightning Network

LNURL is a range of lightning-network standards that allow us to use lightning-network differently. An LNURL-pay is a link that wallets use to fetch an invoice from a server on-demand. The link or QR code is fixed, but each time it is read by a compatible wallet a new invoice is issued by the service and sent to the wallet.

Wallets supporting LNURL

Usage

  1. Create an LNURLp (New Pay link)
    create lnurlp

    • select your wallets
    • make a small description
    • enter amount
    • if Fixed amount is unchecked you'll have the option to configure a Max and Min amount
    • you can set the currency to something different than sats. For example if you choose EUR, the satoshi amount will be calculated when a user scans the LNURLp
    • You can ask the user to send a comment that will be sent along with the payment (for example a comment to a blog post)
    • Webhook URL allows to call an URL when the LNURLp is paid
    • Success mesage, will send a message back to the user after a successful payment, for example a thank you note
    • Success URL, will send back a clickable link to the user. Access to some hidden content, or a download link
  2. Use the shareable link or view the LNURLp you just created
    LNURLp

    • you can now open your LNURLp and copy the LNURL, get the shareable link or print it
      view lnurlp
  3. Optional - add Lightning Address

    • attach a username to your lnurlp to create a lightning address
    • the LN address format will be username@lnbits-domain-name
    • Find out more about the lightning address spec at lightningaddress.com

Update your LNURL-pay extension

Now that the extensions are taken out of core LNbits we can update each extension separately without the need to reload or restart LNbits as a whole. This new version of the extension will give you the option to add a Lightning Address to each LNURLpay link.

  • Open your LNbits instance as super admin (not as a regular user. You will find the SuperUser-ID in your server logs on restart of LNbits. Use that to bookmark and manage LNbits from there in the future.) Now lets install the new version of a given extension like extensively described in this guide. In short:
  • Go to "Mange extensions", click on "ALL", search for e.g. LNURLp, click on "Manage"
  • Open the details of the extension and click on version 0.2.1, click "Install". You´re done!

lnurl-p-1.jpg

  • Open the LNURLp extension from the left panel
  • If you already have had some LNURLp defined, you can now click on edit and add a LN Address to each. Note that this will change your QR-Code!
  • If you didn't create any LNURLp before nothing changed except the window for defining new ones

lnurl-p-ln-address.jpg

Now you can receive sats to your newly created LN address. You will find this info also in the transaction overview for each payment (click on the green arrow).

lnurl-details.jpg

lnurlp's People

Contributors

callebtc avatar bitkarrot avatar dni avatar arcbtc avatar talvasconcelos avatar motorina0 avatar prusnak avatar arbadacarbayk avatar bashy avatar michaelantonfischer avatar

Stargazers

 avatar 22388o⚡️  avatar mrbpp avatar K. N. avatar nully0x avatar Anatoly Chernov avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar mrbpp avatar  avatar

lnurlp's Issues

Capital Letters in LNaddress fail

Though i get that the DB-entries need a harmonized format it should not be a requirement in the frontend.
Can we reformat from capital to small letters on saving (if no such lnaddress is already stored) ?

Bildschirmfoto 2023-08-27 um 15 12 18

migrate from secp256k1 to coincurve

i think we should just migrate to coincurve - it is well maintained (last secp256k1 release was in 2021) - and even CLN uses coincurve and not secp256k1 for their python plugins

lnurl verify

it would be extremely helpful to be able to verify that an invoice was paid

suppose i run a website for someone and i need to verify that someone, (not me), was paid

i can generate an invoice (easy), present a payment url (easy), and then verify that it was paid (impossible now, unless it's an alby address (this is my solution.. hey client, use alby or wos or muun))

using webhooks is nice, but is nonrecoverable and hard to test (localhost webhook, etc) and requires my client to set it up

ideally a well-known-verify url can be used

or a protected endpoint is ok too

alby and wos and others support lnurl-verify

but it's not universal, mostly because lnurlp doesn't ship with it

at the very least it can be a checkbox to turn it on

[BUG] False error-msg after wrong but unsaved input

Legend LNbits

Wrong input of text into "Success-URL",
delete (not saved!) and fill text into right field "Success Message"
=> Error https missing, right credentials cannot be saved anylonger without exiting and full redo

Screen.Recording.2024-03-29.at.13.27.37.mov

User link already exist error when UPDATING

telegram-cloud-photo-size-4-5875436113726914479-y

When I press on UPDATE PAY LINK I obtain this error, saying there is already a user with that name, which is not logical. If there is a button to UPDATE, it should UPDATE, not return an error. I'm not creating a new user, I am UPDATING an existing one.

v0.4.4

Issues accessing LNURLp behind NGINX reverse proxy

Hello, I have an nginx reverse proxy set up in front of LNBits on my Umbrel.

I can access LNBits with no problems both on local network and on clearnet.

However LNURLp has some problems.

For example, if I try using the LN address I made, I get this error:

2 validation errors for LnurlPayResponse callback URL host invalid, top level domain required (type=value_error.url.host) callback URL scheme not permitted (type=value_error.url.scheme; allowed_schemes={'https'})

I get the same error when trying to use the LNURL, the endpoints causing these issues are

/lnurlp/{link_id}
/.well-known/lnurlp/{user}

DNS for _LUD16 addresses

Is there a way to set something like a wildcard record for _lud16 addresses like _lud16.* instead of creating individual txt records like _lud16.herd https://lnb.bolverker.com/.well-known/lnurlp/herd?

Currently I'm manually creating new records for each new address, but I noticed this morning that the addresses created using the lnurlp extension on legend.lnbits.com work right away.

How'd you guys do this?

Potential issue with local LNURLp extension

Hi there, not sure if it’s an issue or only a bad configuration of my local LNbits environment.

But if I install the extension LNURLp on any local server (raspibolt) and cofigure and generate an invoice QR-code, i’ll always get following error message, if I will spend some sats over any lightning wallet:

«Error: Failed to decode invoice, please try again» or «This dosen’t do be a lightning invoice»

Screenshot 2023-08-26 at 16 20 37

in the meantime i have compared the LNURLp QR code with a legend LNbits invoice. it is all the same except for one exception. with the legend invoice the wallet ID is a number, with my local LNbits wallet the ID consists of letters. as i understand it, this could be the problem that triggers the error message.

and if yes, how can I fix that?

@arcbtc

Rest of my config seems to be right and working. I used this manual:
https://raspibolt.org/guide/bonus/lightning/lnbits.html

Username already exists. Try a different one.

When I edit paylink and there is already a set username (I don't change it). On saving I see this error:

Exception: Username already exists. Try a different one.

The workaround is to unset it and then set it again in another edit.

Duplicate LNURL Pay Link Identifiers Allowed via API

Dear LnBits Team,

I've encountered an issue where the API allows updating LNURL pay links with identifiers that are already in use. When creating a pay link, the system correctly identifies duplicates and prevents the operation. However, the same validation does not seem to be in place when interacting with the update endpoint.

This can lead to multiple LNURLs with the same identifier, which could cause confusion or errors in payment processing. Since the GET /lnurlp/api/v1/links/ endpoint only returns links for a single account, there's no way to perform a comprehensive check for uniqueness from the client side.

Thank you for looking into this matter.

Raffle mode

There is a lnurld project that primarily functions as a basic lnurlp server, but it has a unique Raffle feature that caught my eye.

Here's how it works.

  1. The admin activates 'raffle mode' for a specific lnurlp account.
  2. Once activated, every time someone makes a payment using this lnurlp, they receive a success message like "Ticket ABCDEF." Here, 'ABCDEF' is an alphanumeric string derived from the preimage of the payment.
  3. The admin can access the raffle screen to:
  • Select winners at random by clicking the 'DRAW' button. Each time it's pressed, the 'ABCDEF' token and the corresponding payment preimage are displayed. This is usually shown on big screen so everyone in the room can see it. We show the preimage because some LN wallets might not display success messages in their transaction history/details, but many do show the preimage.
  • After the raffle concludes, admin can clear the database of all issued tickets. This is useful so admin can start a new raffle the other day.

We have a blast with this Raffle at our meetups, and it'd be awesome to see it integrated into LNbits!

P.S.: If you feel this might be beyond the scope of the lnurlp extension, please let me know. But considering a separate raffle extension would likely duplicate about 80% of what lnurlp already accomplishes, I thought it could be a good fit to add it directly to this one.

[Feature Request] Fee option

Similar like for Lightning Devices, it would be nice to have the option to set a custom fee percentage for each LNURLp or LNAddress.

Install fails on lnbits docker

Using the latest docker image (docker pull lnbitsdocker/lnbits-legend:0.11.0), I am able to install most extensions, including lnurlw, but lnurlp fails:

docker lnbits logs says:

2023-10-14 05:52:31.39 | INFO | 172.17.0.1:50356 - "GET /extensions?usr=XXXXX HTTP/1.1" 200
2023-10-14 05:52:37.31 | INFO | 172.17.0.1:49686 - "GET /api/v1/extension/lnurlp/releases?usr=XXXXX HTTP/1.1" 200
2023-10-14 05:52:42.41 | INFO | lnbits.extension_manager:download_archive:377 | Downloading extension lnurlp (0.3.3).
2023-10-14 05:52:43.25 | INFO | lnbits.extension_manager:extract_archive:402 | Extracting extension lnurlp (0.3.3).
2023-10-14 05:52:43.28 | SUCCESS | lnbits.extension_manager:extract_archive:439 | Extension LNURLp (0.3.3) installed.
2023-10-14 05:52:43.30 | ERROR | lnbits.core.helpers:migrate_extension_database:22 | No module named 'environs'
2023-10-14 05:52:43.30 | WARNING | lnbits.core.views.api:api_install_extension:814 | Please make sure that the extension `lnurlp` has a migrations file.
2023-10-14 05:52:43.31 | ERROR | lnbits.app:http_exception_handler:501 | HTTPException 500: Failed to install extension lnurlp (0.3.3).
2023-10-14 05:52:43.31 | INFO | 172.17.0.1:49686 - "POST /api/v1/extension?usr=XXXXX HTTP/1.1" 500

Even though it says "Extension [...] installed.", the extension does not show up in the "installed" tab.

Here's a successful install of lnurlw for comparison:

2023-10-14 06:14:00.30 | INFO | 172.17.0.1:43794 - "GET /api/v1/extension/withdraw/releases?usr=XXXXX HTTP/1.1" 200
2023-10-14 06:14:04.10 | INFO | lnbits.extension_manager:download_archive:377 | Downloading extension withdraw (0.1.4).
2023-10-14 06:14:04.82 | INFO | lnbits.extension_manager:extract_archive:402 | Extracting extension withdraw (0.1.4).
2023-10-14 06:14:04.83 | SUCCESS | lnbits.extension_manager:extract_archive:439 | Extension LNURLw (0.1.4) installed.
2023-10-14 06:14:04.88 | DEBUG | lnbits.core.helpers:run_migration:39 | running migration withdraw.1
running migration withdraw.1
2023-10-14 06:14:04.90 | DEBUG | lnbits.core.helpers:run_migration:39 | running migration withdraw.2
running migration withdraw.2
2023-10-14 06:14:04.94 | DEBUG | lnbits.core.helpers:run_migration:39 | running migration withdraw.3
running migration withdraw.3
2023-10-14 06:14:04.96 | DEBUG | lnbits.core.helpers:run_migration:39 | running migration withdraw.4
running migration withdraw.4
2023-10-14 06:14:04.99 | DEBUG | lnbits.core.helpers:run_migration:39 | running migration withdraw.5
running migration withdraw.5
2023-10-14 06:14:05.02 | DEBUG | lnbits.core.helpers:run_migration:39 | running migration withdraw.6
running migration withdraw.6
2023-10-14 06:14:05.09 | INFO | 127.0.0.1:46720 - "DELETE /withdraw/api/v1?usr=XXXXX HTTP/1.1" 404
2023-10-14 06:14:05.12 | INFO | 172.17.0.1:43794 - "POST /api/v1/extension?usr=XXXXX HTTP/1.1" 200
2023-10-14 06:14:05.40 | INFO | 172.17.0.1:43794 - "GET /extensions?usr=XXXXX&activate=withdraw HTTP/1.1" 200

This one does show up in the "installed" tab.

One can set duplicate LNaddress to already existing

When I am creating a new Pay Link with a LN address that is colliding with already existing one, I'll get this error:

Username already exists. Try a different one.

However, when I am editing an existing Pay Link and I change LN address to something that is already present in the system, no error is shown and the LN address alias is saved.

Luckily, this does not seem to overtake the existing LN address, but still, it would be nice if this was not allowed at all.

Webhook broken (?) plus parameter documentation

Hey,

We're trying to get the LNURLp webhook working with our Discord, but it doesn't seem to be firing. Other webhooks working fine.

Is there an bug with the latest version 0.2.1?

Also, could someone update the README to explain how to use the webook headers and webhook custom data fields.

Cheers!

Enable the binding of LN Addresses to one of a selection of registered subdomains

We (BTC Map) are wanting to rollout PoS, NIP-05, LNURLp globally using country-specific subdomains.

e.g.

uk.btcmap.org
de.btcmap.org

We can handle this with the current NIP-05 extension, but not with the LNURLp extension when it comes to LN Addresses.

Is it feasable to register multiple sub-domains within the core LNBits instance so that extensions like LNURLp can offer sub-domain specific features?

We'd like LN Address usernames to be unique within a sub-domain, not across the entire LNBits instance.

e.g.

merchant1.uk.btcmap.org != merchant1.de.btcmap.org

Can not reuse LNURL address.

I had a user with a LNURLp address, no problems there.

  • Deleted the user without first deleting the LNURLp address.
  • Created a new user.
  • Tried creating a LNURLp with the same address ([email protected]) and got the error:

Username already exists. Try a different one.
500

The referenced user no long exists, but it seems his LNURLp address is not deleted.
If I first delete the LNURLp address and THEN delete the user, I can reuse the address.

LNbits 0.10.8

Zapsupport version preventing startup if Nostrclient uninstalled

Trying to reinstall Nostrclient extension. Uninstalled in Lnbits. In "Manage Extensions" it would not give the option to then reinstall.

Restarted Lnbits and it gave an error saying Nostrclient not installed and that lnurlp should be checked to ensure the extension is following conventions. This prevented Lnbits from starting-up.

Had to delete lnurlp folder manually to get Lnbits to start.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.