-
Notifications
You must be signed in to change notification settings - Fork 28
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
Keysend TLV type mapping for sphinx #2
Comments
One more thing that came to mind: how do you signal whether the payload is binary or human readable text? Since there is very little to add to our keysend plugin I'm currently adding the messages to it directly instead of going through the noise plugin. |
Sphinx uses the key of 133773310 here: https://github.com/stakwork/sphinx-relay/blob/master/src/utils/lightning.ts#L18. The content is bytes (JS ByteBuffer object)... internally its actually stringified JSON (with the signature appended at the end). We validate the signature externally, it doesn't need to be validated inside the plugin. |
So signatures are handled completely by sphinx-relay? No need for us to pass the signature along? That makes it easy for us :-) |
Would it make sense for me to just add a The main problem with this is that the key you're using is an even key, which means we can't accept it without understanding it in the receiving plugin. The spec says we're supposed to reject payments with even fields we don't implement internally, this is meant as a security measure since we don't know what we're agreeing to by accepting the payment. Not sure how other implementations handle this. |
Dang, my mistake on the even number. I should've read the spec more carefully. I guess i can just switch it 13377331...
|
No problem, I have a patch pending for the Should get it working in a couple of hours. |
Pull request for keysend + extra-tlvs + extra-tlv-type allowlist is up for review: ElementsProject/lightning#4610 Also mentioned sphinx in the integration test to make sure it fits the use-case we have here: inject a binary field into the payload, and then call the plugin hook we'll use to return notify the app about the incoming payment with the binary field. As far as I see it this should match exactly our use-case here :-) |
We deployed the version of c-lightning with The |
During our call yesterday @Evanfeenstra mentioned that there might be some customization required to get the
keysend
andnoise
delivery working with the sphinx-relay. So I'd like to see how we can map the required parts to the existing fields, and if changes are required. Currently thekeysend
plugin uses this type to indicate that there is a preimage included in the payload:https://github.com/ElementsProject/lightning/blob/75720ad0e1690052c108fbf457ded807bf09d6c1/plugins/keysend.c#L10
While
noise
uses these fields to transfer the information:https://github.com/lightningd/plugins/blob/775fd8a3c29b0a5a2a4e7003f2f23b8644672348/noise/noise.py#L15-L18
The preimage type is the same and we use a chain of responsibility to fail in keysend if unknown even field types are present, so it hands the HTLC over to the
noise
plugin if there is a message attached.Which fields are required by sphinx and what types are used for them? I assume that the message, being encrypted and prepended with the pubkey on the sphinx-relay side, is intended to be binary (which requires a minimal change to the noise plugin anyway).
The text was updated successfully, but these errors were encountered: