BlueWallet / LndHub

Wrapper for Lightning Network Daemon. It provides separate accounts for end-users
http://LndHub.io
MIT License
793 stars 198 forks source link

Allow lightning payments to nodes with accept keysend #262

Open Astro92 opened 4 years ago

Astro92 commented 4 years ago

As of LND 0.9 —accept keysend has allowed for spontaneous payments to nodes, this only requires the nodes pubkey. Therefore within the lightning wallet allow the invoice field to read/ scan node pubkeys to allow sending payments.

steflsd commented 4 years ago

+1 to this. It would be great to send any amount to someone's wallet without them needing an invoice. This opens up things like microtipping etc.

microlancer commented 3 years ago

I believe c-lightning also supports this.

https://lightning.readthedocs.io/lightning-keysend.7.html

It would be a very useful feature.

blankscreengithub commented 3 years ago

I vote for this feature too. I think it's a game changer for operability and greater adoption.

  1. Coffee shop has public key as QR code at checkout.
  2. I open my BlueWallet Lightning Wallet
  3. I enter the amount to send
  4. I scan the QR code
  5. Barista at terminal sees my transaction come in
  6. I get my goods

No invoice needed. This would also work for small shops, craft vendors, garage sales, etc.

lndhub-admin commented 3 years ago

if We allow user(account) pay own invoices in BlueWallet Client, IE: change :

screen/lnd/scanLndInvoice.js line 194

const currentUserInvoices = wallet.user_invoices_raw; // not fetching invoices, as we assume they were loaded previously
    if (currentUserInvoices.some(invoice => invoice.payment_hash === decoded.payment_hash)) {
      setIsLoading(false);
      ReactNativeHapticFeedback.trigger('notificationError', { ignoreAndroidSystemSettings: false });
      return alert(loc.lnd.sameWalletAsInvoiceError);
    }

and have BlueWallet Client assume when scan(paste) QR that only consist of pub_key (or is constructed as keysend:pub_key ?) then BlueWallet Client takes amount and has checkbox [x] keysend flagged, when button SEND it calls new function /keysend in LndHub

LndHub /keysend takes --amt --pub_key, where function /keysend verifies --pub_key with lightning.getnodeinfo then generates a invoice with user credentials pay internal deducts balance of --amt for user account ( reuse code in /payinvoice) then :

lightning.sendpayment --amt --pub_key --keysend

this would have deducted -amt from user(account) and made a keysend (invoice made and paid from user(account), all accounted in ledger)

need change in BlueWallet Client allow "PAY OWN" invoice and add in BlueWallet Client assume when QR/paste is only a pub_key it is a keysend request ***

lndhub-admin commented 3 years ago

with regards to need change in BlueWallet Client allow "PAY OWN" invoice is not needed for /keysend since LndHub would create invoice in function and not have the BlueWallet Client check.

Pay own invoice would be needed for LndHub-Admin be able send commands from BlueWallet Client, so ease on restriction "pay own invoice" is still welcome for planed future functionality.

TheCherry commented 3 years ago

I build atm a project for my community and want give them sats for specific things as a reward. Now my problem is that I need this feature too. The user should link his lndhub account with a permanent invoice, so I am able to send them sats then ever I want. The problem is now, that only this delay my project.

xraid commented 3 years ago

keysend being invoice-less so no need for a static invoice the BlueWallet Client can adapt to keysend easily, its harder to receive a keysend to a LndHub account wallet(card)

instead for Your use case :

if all your users connected to the same LndHub one can build a component that can pay the account/s without users actively need create invoice ...

this component is on the drawing board called a Grant component where admin of LndHub can pay into accounts

https://github.com/lndhub-admin

Overtorment commented 3 years ago

its probably easier to add ln address support