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

[Feature Request] Add Support for Nostr Zaps #78

Open
steveboi123 opened this issue Feb 24, 2023 · 4 comments
Open

[Feature Request] Add Support for Nostr Zaps #78

steveboi123 opened this issue Feb 24, 2023 · 4 comments

Comments

@steveboi123
Copy link

Hi,

Would it be possible to add support for Nostr Zaps? Seems very useful.

@PlebeiusGaragicus
Copy link

I'd love to look into this. It seems NIP-57 covers some things about Zaps: https://github.com/nostr-protocol/nips/blob/master/57.md

I'm not yet sure how to get profile information about a pubkey in order to get the needed info to send a zap.

@PlebeiusGaragicus
Copy link

Ok - I figured out how to get info from a pubkey #82.

{
    "banner": "https://nostr.build/i/nostr.build_c91bc3ae722fb9b808227c37772b1df9d829173bb56193871048baffc47d9e8f.jpeg",
    "website": "",
    "lud16": "[email protected]",
    "picture": "https://nostr.build/i/nostr.build_eb1cd3b4c84aa4a354647ddcaf5bfe13bb26761caf55d00e057b9287531e4490.jpeg",
    "display_name": "Plebeius Garagicus",
    "about": "Inspiring the next generation to build open-source #bitcoin software for the benefit of all\n\nhttps://github.com/PlebeiusGaragicus",
    "name": "PlebeiusG"
}

So now if someone has a lightning address setup we can fetch it.

Next I need to figure out how to initiate a zap...

@PlebeiusGaragicus
Copy link

Ok - also refer to LUD-16: Paying to static internet identifiers.

First, we convert the LUD and send a GET request to the resulting URL

Then, after receiving the callback URL we draft an event of kind 9734 with details about our zap

Next, we sign our drafted zap request and sent it to the callback URL.

The callback URL should return an LNURL (I think) which will be the lightning invoice we then need to pay.

So, we are able to convert, for example, an lud16 of "[email protected]" into what appears to be an LNURL: lnbc10u1pj9lu24pp5xkeezk8gky ... v3gz2hhzhngpc4umnv

Next, I need to figure out how to use LND (or something similar) to pay this invoice...

There's also mention of publishing a zap receipt so that nostr relays are able to tell who zapped whom and talley total sats, etc.

@steveboi123
Copy link
Author

@PlebeiusGaragicus are you able to make a Pull Request with your implementation?

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

No branches or pull requests

2 participants