Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add lnurl-pay (LUD-06) support #7839

Merged
merged 6 commits into from
Jun 30, 2022
Merged

Conversation

SomberNight
Copy link
Member

@SomberNight SomberNight commented May 31, 2022

This includes #7573 and #7683, and some clean-up commits.

Support for paying to "lnurl-pay" is added to the Qt and kivy GUIs.

"lightning address" (LUD-16) support is not added for now, mainly as the email-address-like format is ambiguous and cannot be distinguished from e.g. openalias.

Unlike in a previous version of this PR, in the Qt GUI, the network requests are not done on the GUI thread, instead they are async and use qt signals.
Re the kivy GUI, they are still running on the GUI thread and blocking the GUI. This can be fixed later or as a follow-up.

closes #7573
closes #7683


Re Qt paytoedit specifically, it seems hard to have good UX.
There are design questions, such as

  • re user typing into the field, how do we know they are finished - e.g. when to validate the text or do network requests if needed
    • we could wait until the text field loses focus
    • we could start a timer on textChanged(), i.e. do network requests if user hasn't typed for e.g. 1 second
    • maybe add a dedicated button...
    • this PR takes the following approach:
      • add param to check_text to toggle if network requests are allowed ("full check")
      • every 0.5 sec, if the textedit has no focus, do full check
      • on textChanged()
        • detect if user copy-pasted by comparing current text against clipboard contents,
          if so, do full check
        • otherwise, do partial check
      • on clicking ButtonsWidget btns (scan qr, paste, read file), do full check
  • note that "openalias" ids and "lightning address" ids can both look like email addresses and hence can collide. how to handle this?
    • we give priority to "lightning address" and do network request for that first
    • if that fails, we do "openalias" network request
    • "lightning address" support is postponed for now

Examples to test in Qt paytoedit:

  • mempool@jhoenicke.de
  • lnurl
    • lightning:lnurl1dp68gurn8ghj76ngdajku6trddjjuer99uh8wetvdskkkmn0wahz7mrww4excup0d4jk6ur0dakqhmhnx2
  • bolt11
    • lnbc3680n1p3zka2ypp5nf74fk49ehwmqfdkwfn86q4pgytjttrdqa4gg64v7tntrf5ws9vsdpdg3hkuct5d9hkugrxdaezqjn0dphk2fmnypkk2mtsdahkccqzpgxqyz5vqsp5d69tlczphwcg62p9pc307yd59f2xacnkdhfsnxx3a7pgmhmmmg7q9qyyssqdnhpzxrhf47x5srjxmzv8wq7mkeuyca0lqy55vvfxxtqdguc67mhy9s8qhvn9fpmk65qs36e06gj3rmvslalf9mds8ptlssfnu5kkfspyrxu2p
  • openalias
    • donate.getmonero.org
    • donate@getmonero.org
  • bip70
    • bitcoin:?r=https://bitpay.com/i/5V4bqzj8xHs5UepqA9WCzw
  • bitcoin address
    • bc1qq2tmmcngng78nllq2pvrkchcdukemtj56uyue0
  • multi-line onchain outputs
    tb1qk3g0t9pw5wctkzz7gh6k3ljfuukn729s67y54e, 0.002
    tb1qr7evucrllljtryam6y2k3ntmlptq208pghql2h, 2!
    tb1qs3msqp0n0qade2haanjw2dkaa5lm77vwvce00h, 0.003
    tb1qar4ye43tdfj6y5n3yndp9adhs2wuz2v0wgqn5l, 3!
    

@SomberNight SomberNight force-pushed the 202202_lnurl_2 branch 3 times, most recently from 583b020 to 4e09d04 Compare June 7, 2022 14:36
@ecdsa ecdsa added this to the 4.3.0 milestone Jun 15, 2022
bitromortac and others added 5 commits June 29, 2022 16:18
* bundles all payment identifiers into handle_payment_identifier
* adds lnurl decoding
* adds lightning address decoding
- add param to _check_text to toggle if network requests are allowed ("full check")
- every 0.5 sec, if the textedit has no focus, do full check
- on textChanged()
  - detect if user copy-pasted by comparing current text against clipboard contents,
    if so, do full check
  - otherwise, do partial check
- on clicking ButtonsWidget btns (scan qr, paste, read file), do full check
@SomberNight SomberNight changed the title add lnurl-pay (LUD-06) and lightning address (LUD-16) support add lnurl-pay (LUD-06) support Jun 29, 2022
- in lnurl.py, make request methods async
- in Qt GUI, lnurl network requests no longer block the GUI thread
  - but they still do in the kivy GUI
- "lightning address" (LUD-16) support is removed for now as the
  email addresses are indistinguishable from openalias email addresses
  (both protocols should have added and enforced a prefix, or similar,
   to remove this kind of ambiguity -- now we would need to make a
   network request just to identify what kind of ID we were given)
@SomberNight SomberNight merged commit 0522643 into spesmilo:master Jun 30, 2022
@SomberNight SomberNight mentioned this pull request Dec 6, 2022
SomberNight added a commit that referenced this pull request Mar 14, 2023
probably got disabled in or around #7839 by accident
SomberNight added a commit that referenced this pull request Mar 14, 2023
Probably got broken in #7839 ,
which got released in 4.3.0, ~7 months ago.
As no one complained, this really again raises the question of removing openalias...

related #6232
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants