lnbits / lnurlp

MIT License
9 stars 8 forks source link

Zap support #4

Closed callebtc closed 1 year ago

callebtc commented 1 year ago

This PR adds zap support to the LNURLp extension. It requires the nostrclient (link) extension to be installed in order to send zap receipts to nostr. Many relays should be added to nostrclient so enough people see the zaps (the zap receipts are not yet sent to the relays in the zap note, see todo).

Todo:

prusnak commented 1 year ago

Is it okay to generate a new zap pubkey every time LNbits is restarted?

I'm not saying it isn't, what I am saying is that I don't really understand why zaps are required to be signed by arbitrary key at all, if this is possible.

callebtc commented 1 year ago

Is it okay to generate a new zap pubkey every time LNbits is restarted?

I'm not saying it isn't, what I am saying is that I don't really understand why zaps are required to be signed by arbitrary key at all, if this is possible.

Yeah I think it's ok, nobody is checking anything anyways (there would have to be a list of certified zap servers otherwise). I've hardcoded it before and I'm planning to add some sort of setting where you can add the pk as an admin user maybe.

Have you tried the PR?

Bashy commented 1 year ago

What would be the downside of a user defined privkey for the zapper?

It'd allow to whitelist the zapper pubkey on some private or write restricted relays.

callebtc commented 1 year ago

What would be the downside of a user defined privkey for the zapper?

Nothing in particular, it would just be a setting in the interface.

It'd allow to whitelist the zapper pubkey on some private or write restricted relays.

That's a good point!

prusnak commented 1 year ago

I've hardcoded it before and I'm planning to add some sort of setting where you can add the pk as an admin user maybe.

Yeah, it makes sense to have the similar setting to CASHU_PRIVATE_KEY in the cashu extension to set the Zap private key.

talvasconcelos commented 1 year ago

Possible fix #9 ?