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 keysend method definition #42

Merged
merged 3 commits into from
Mar 24, 2022
Merged

Conversation

kiwiidb
Copy link
Contributor

@kiwiidb kiwiidb commented Mar 22, 2022

Closes #33
We have recently added keysend support in the Alby extension. We also added webLN methods for this.

I have to admit I was totally unaware of the discussion here around keysend up until some minutes ago. This is how we implemented it in Alby, if there are obvious flaws in the interface that we decided on we could patch them later.

Parameters

  • destination: Mandatory. Hex encoded public key of the destination node. This is a string of length 66 that starts either with 02 or 03.
  • amount: Mandatory. The amount of satoshis you want to send as a stringified integer.
  • customRecords: Mandatory. A map<string, string> of records that are appended to the payment. The key should be a stringified integer from the TLV Registry. The value should be an unencoded, plain string. The webLN provider should handle the encoding if necessary. If no custom records are needed, an empty object must be passed in.

This PR supersedes #34, but it is quite similar. We have added support for custom TLV records to be passed in, because this is needed for podcasting 2.0 web apps.

Copy link
Member

@wbobeirne wbobeirne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, glad to see y'all pushing this forward! A few notes here, I just want to make sure webln is as easy to use as possible, and that they types are as permissive as possible to allow TS devs to safe-guard against common forms of input.

src/provider.ts Outdated Show resolved Hide resolved
src/provider.ts Outdated Show resolved Hide resolved
kiwiidb and others added 2 commits March 23, 2022 09:09
Co-authored-by: Will O'Beirne <[email protected]>
Co-authored-by: Will O'Beirne <[email protected]>
@kiwiidb
Copy link
Contributor Author

kiwiidb commented Mar 23, 2022

Cool, I've commited your suggestions. I'll make a patch in Alby as well.

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.

Support for KeySend (a.k.a. Sphinx Send)
3 participants