-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[WIP] multi: add new draft key send mode for spontaneous payments #2455
Conversation
This is the best feature that we have in lightning !! |
Looks very VERY cool.
This would be bullish for exchange adoption. |
Imagine we have 3 users on our exchange: Make 3 "Sphinx Addresses":
Then we could just fetch our received payment history, check the accountID, and attribute the amount to the user's balance on our DB. Super awesome. Can't wait. I highly recommend standardizing an "address" format though. |
htlcswitch/link.go
Outdated
) | ||
|
||
needUpdate = true | ||
continue | ||
// An empty EOB means they didn't send su any special |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
send us
*
I'm running two nodes on testnet and spamming myself with tiny amounts (sphinx send ftw!) ... So I'm wondering if there's a way not to allow these spamming txs if the receiving end does not wish to be spammed? Second question: Before making a Sphinx send should there be a question like |
Is there a reason why I should not want these payments although very small? Does this somehow corrupt my channel's fitness? If possible (D)DoS is the reason, there might be a better way how to perform it on a LN node. |
@Roasbeef are you writing up a BOLT for this? I'd like to collaborate on some functionality that exchanges would like. Starting with the points I made above. |
@prusnak Hi,
In the past we tested this on testnet and my node's constant stream of sending payments for several hours did crash another tester's node. I haven't tested this with Sphinx send yet, but I'm planning to test it, you can help too if you want to. (I've been only spamming myself with about 30 txs at a time. To test crashing maybe should do a few thousands of txs or more overnight... lol) However, even with no crashing I am just wondering if someone might not like it (just wondering never know), so for caution I'm just raising the question. As for me, I would not mind to receive streams of satoshis though, the more the merrier! Haha ... :D |
Nodes can reject this at will. You can already spam a node by sending them an HTLC with an unknown payment hash. If someone is spamming you by giving you free money then well....🤑
The main point of synchronization would be finalizing the EOB format (see the PR linked in the description). From there, we'd reserve a type, and then star to specify the behavior/encoding around that type. |
@Roasbeef First crash report! Strange that my node didn't crash before when I tried the same with a non-sphinx-send node that wasn't running on Tor. EDIT: The other node got the PR compiled after, then tried to Sphinx send to my node (we both didn't know my node crashed at the time), so he tried a sendpayment and his node crashed too, with same error. |
Yeah that's a known bug due to a change in the way I handle pubkeys, easy fix, remember that this PR isn't final at all. |
5300038
to
552f239
Compare
Latest diff patches that issue. |
@Roasbeef It's fixed, Thank you! Suggestion: Could we have an option to set the minimum amount that we would accept? Something like EDIT: And the default is 1 sat like it is now. |
Companies are likely to prefer to reject payments which are from unknown senders to limit their legal liabilities and paperwork. If they're accepted, they have to be accounted for. The worst case is if they're accepted and not accounted for. |
I get the following payment error when i try to send using sphinx mode.
|
When calling this through API on simnet, the channel is closed. On sending node, I have:
The receiving node:
Both nodes run this branch. API called with destString=nodepubkey, amt=100, final_cltv_delta=144, sphinx:true |
I'd love to put invoice-free payments to use :) |
552f239
to
2b0fec8
Compare
Just updated this branch to use the latest version of the EOB encoding format and TLV! Tested locally and it works just the same as before, and the API is also unchanged as well. The current format is what will likely end up being used in BOLT 1.1, so it shouldn't change any longer. |
2b0fec8
to
2cd0f9b
Compare
To avoid any confusion, I renamed the "sphinx" options to "keysend", it's more descriptive of the new payment mode as it only needs a pubkey to send a payment to another node. |
Love this new feature! So many more use case will be possible with it! |
@Roasbeef Is there a target release date for this feature? Will it be released this quarter and will be in lnd 0.8.0? |
I wish that too 🙏 |
@Roasbeef features such as a password and extra ID space would be awesome for exchanges. |
@Roasbeef I'm playing around with this feature and I'm wondering if it's possible to make a REST API call to do a payment like this (https://api.lightning.community/rest/?shell#v1-channels-transactions)? |
So I never got this to work with the gRPC API but it works fine with the REST API. For anyone else running into this problem, this is how you do a spontaneous payment from the API:
My next question using this experimental new feature; the invoice that's created when doing a spontaneous payment is not stored anywhere, i.e.:
At first, I thought this was an issue with Zap wallet (which is connected to my receiving node) as the spontaneous payments never show up, but in fact, if I just call Has anyone else ran into this issue? |
Superseded by #3795. |
In this commit, we add new feature to
lncli sendpayment
(and the RPC): the ability to send a payment to a destination without first needing to have an invoice. This allows users to start exploring a new set of use cases that benefits from this type of spontaneous payment. The payment can also carry additional application-specific data such as an account ID, API call, etc. This new feature requires the new EOB (extra onion blob parsing) implemented here. The coolest part about this new feature is that it can be used today in the wild as long as both nodes are updated to this branch!An example run on the cli:
NOTE: This is only a draft implementation and while it works today on mainnet out of the box (if both sides are upgraded) much this will likely change. Notably the modifications in the link are very hacky and will likely be refactored in preparation of AMP and the like.
Fixes #132.