BitcoinDesign
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # LNURL / Documentation UX / Expert Interview :::info The goal of this series of interviews we'll be doing is to gain an understanding of the limitations of lightning that birthed LNURL. We will also be exploring the setup requirements and use cases, that can serve as a way to onboard developers looking to implement one of the LNURL solutions. ::: ## Foundations We start with the basic things of how lightning works, and how a lightning newbie may interact with it to show some of the benefits of LNURL. ### Setup lightning First, you set up a lightning node, either using c-lightning, lnd or with a node toolkit like Umbrel, or BTC Pay Server. You will then need to configure your lightning node ### Opening channels Then you're able to open channels with various parties who you may be transacting with, or whom you have some relationship where they provide me the capacity to route payments through them (lightning service provider). ### Personal use You may then choose to connect to your node with an application like Zues, or Zap which would allow you to generate invoices remotely that you can then share with the payer. ## Integrating payments Enter LNURL, LNURL is a specification for interacting with my lightning node through HTTP. - What options do I have besides HTTP? ## lnurl-pay ### Conventional lightning solutions - Generate many invoices upfront with long expiration times. --- - lnurl-pay, dont want to connect it to a lightning node - lnurl endpoints - People misunderstand that you need lnurl capabiltiies, its a wrapper around a flow. instead of clicking to pay they scan a QR Code. - include a fixed lnurl address on the website. a static thing, and encoded is a http url. - the users wallet will automatically fetch the invoice. - Use case physical static QR Codes, and configure an invocie on the fly - problem: if you have 100 products you cannot work. - lnurl pay chat Fixes the hash of the invoice. Success action. When the wallet sends the request for the invoice, it also send the comment. - i want an invoice to pay for this. and here is my wallet. - encrypted message. - **successAction** - Success action is received by the wallet not by the web page. - how can the --- - comment field, ### Problems with conventional lightning solutions - ... ### Comparison to on-chain - xpubs can be used on-chain as an on-chain invoice generator. - this is not the same as a static address though, bip47 payment codes would be the closest solution to provide a static payment code. ### Use Cases You will run into the use case for `lnurl-pay` if you want to automate the creation of invoices. #### Ecommerce In a merchant setup you would need to generate invoices on demand for customers to pay. - lnurl-pay (?) #### APIs If your API requires a payment to provide a response it would need to generate an invoice for consumers. - lnurl-auth(?) - lnurl-pay(?) --- - lnurl-channel(?) - lnurl-withdraw(?) --- ## The Solutions ### lnurl-pay - one line explanation - Pay to static QR/NFC/link - user story - ... - alternative solutions - what convention does it abstract? ### lnurl-withdraw - one line explanation - Withdrawing funds from a lightning service - user story - Today users are asked to provide a withdrawal Lightning invoice to a service, this requires some effort and is especially painful when user tries to withdraw funds into mobile wallet while using a desktop website. Instead of asking for Lightning invoice a service could display a "withdraw" QR code which contains a specialized LNURL. - alternative solutions - the user would have to open their phone wallet, type 155 satoshis, copy the invoice, and paste the invoioce there. - server tells the wallet to give me an invoice, for a specific amount and everything else. - Can be fixed amount or not - Each web server will have to notify the frontend to refresh the page. - what convention does it abstract? - ... - works best if - can have a static endpoint/qr if the amount is fixewd, but your use case may require widthdrawing a dynmaic amount based on the user's - min and max ### lnurl-channel - one line explanation - user story - Suppose a user has a balance on a certain service which he wishes to turn into an incoming channel and service supports such functionality. This would require many parameters so the resulting QR may be overly dense and cause scanning issues. Additionally, the user has to make sure that a connection to target LN node is established before an incoming channel is requested. - alternative solutions - what convention does it abstract? - to open a channel the person has to connect to the other part of the channel, but it cannot connect to a phone. the connection has to connect from the phone to the server. - specical tag on the lnurl channel, when blix reads the qr it doesnt only connect to the lightning node but it also sends an invoice to the lightning node. - node a is trying to open a channel with node b - needs to know the nodeid - needs to know the ip - has to connect - in the case of the phone - the node cant connect to your phone because its not reachable from the itnernet - if your phone connects first to - phone opens a connection to the node. ive open a connect ### lnurl-auth - one line explanation - Authorization with Bitcoin Wallet - user story - A special `linkingKey` can be used to login user to a service or authorise sensitive actions. This preferrably should be done without compromising user identity so plain LN node key can not be used here. Instead of asking for user credentials a service could display a "login" QR code which contains a specialized LNURL. - alternative solutions - what convention does it abstract? - sign up to website with a keypair - ### Persona / Web Developer - (As a web developer famililar with creating HTTP REST APIs -- and I have some basic understanding of lightning for personal payments, but want to integrate it into my website or web service) I'm able to plead ignorance on how lightning works on the underlying level, because as a front-end developer or backend developer, I may not have much knowledge of the inner workings of lightning but want to take advantage of the capability or the opportunities that LNURL can provide me. ## Why not just use AMP? - amp is just keysend with magic ## Why not just use "Offers" in `BOLT12`? - the main advantage is that you have to run a web server. you are service, and already have. youre not talking on a lightning network. - if you are using a custodial service you can implement lnurl code. - it simplfiies your web infrastructure. - its not suppose to be a peer to peer thing, its for services. ## Why not just use `keysend`? - keysend is a more

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully