getAlby / pkgzap

⚡️ View funding information of your dependencies and tip them via lightning
https://pkgzap.albylabs.com/
7 stars 2 forks source link

Support Zaps #58

Open rolznz opened 1 year ago

rolznz commented 1 year ago

When we use NWC we generate a private key for the NWC connection. That can be used to make zaps instead of standard lightning payments. The benefit here is the contribution is public.

Then these contributions can be shown in different ways, like on top contributor scoreboards embedded into the npm package README.

An example of the zap flow can be seen here: https://github.com/getAlby/alby-tools/blob/master/examples/zaps-nwc.js#L37-L44

Since we are zapping with a new private key, it won't have any details about the user. When setting up the NWC connection in the CLI, it would be cool to be able to set at least a name of the user to be associated with the zap (we would need to publish a profile event to the same relays that will be used to zap).

If the user's lightning address has a pubkey, we can zap it. Otherwise we could fallback to the current functionality, but we could also include the user's name as a LUD-18 field (Like ZapPlanner does it).

It might also be cool to support adding a comment along with the payment.

rolznz commented 1 year ago

Also, is there a way to add some metadata to the zap to associate it with the package zapped?

rolznz commented 1 year ago

@im-adithya would you be interested to work on this?