Skip to content

NIP-60: clarify privkey is optional#1695

Closed
patrickReiis wants to merge 1 commit into
nostr-protocol:masterfrom
patrickReiis:clarify-optional
Closed

NIP-60: clarify privkey is optional#1695
patrickReiis wants to merge 1 commit into
nostr-protocol:masterfrom
patrickReiis:clarify-optional

Conversation

@patrickReiis

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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?

@fiatjaf

fiatjaf commented Jan 29, 2025

Copy link
Copy Markdown
Member

I think we should make privkey mandatory actually.

@pablof7z

Copy link
Copy Markdown
Member

I think we should make privkey mandatory actually.

Oh, interesting -- yeah, I'd be game for that.

@patrickReiis

Copy link
Copy Markdown
Contributor Author

I think we should make privkey mandatory actually.

I agree, there's no cons by doing it, unless some clients implemented it without privkey

@patrickReiis

Copy link
Copy Markdown
Contributor Author

Destroyed by: #1730

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.

3 participants