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

NIP-60: clarify privkey is optional #1695

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

patrickReiis
Copy link
Contributor

I am learning Cashu for the first time, so this may not make sense.

However, if I understood correctly, to redeem/spend a Cashu with a spending condition, you need a corresponding private key to sign the Proof. In the context of Nostr, this private key can be the user's own Nostr private key or another private key, not related to the user's Nostr private key.

So, if the client is using the user's own Nostr private key, then the privkey tag wouldn't be needed, correct?

@pablof7z
Copy link
Member

To spend a p2pk-locked cashu you need to sign a non-nostr payload; which is not supported (and won't be supported) by NIP-07 or NIP-46. Tha effectively means that a p2pk-locked to the user's nostr pubkey can only be spent with direct access to the user's nsec (i.e. no nip-07/46 login)

This privkey in the wallet event allows to specify a different pubkey JUST for the p2pk lock so when someone nutzaps that user they lock to it.

This enables clients that don't have access to the user's nsec to redeem the nutzaps.

As a byproduct of this, this completely independent private key can be used to generate recoverable-ecash just like Cashu.me and other wallets do to generate cashu that can be recovered from a seed.

@patrickReiis
Copy link
Contributor Author

Oh now I see it, thanks.

But is this merge request still correct though? I think most clients will prefer to use privkey, but since it's possible to use the user's nsec, then it makes sense to highlight that privkey is optional, no?

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.

2 participants