NUT-XX: Pay-to-Blinded-Key (P2BK)#291
Conversation
… NUT-11; add spec and README entry; ensure proper Markdown formatting
robwoodgate
left a comment
There was a problem hiding this comment.
Tags entry must be included to ensure normalization is consistent
|
The reference implementation for cashu-ts is currently in the v3-hackday branch of my own repo. It is built on top of v3-alpha-2, so I'll PR it to v3-alpha-dev branch once we catch it up to my current v3 tip. |
Co-authored-by: Rob Woodgate <robwoodgate@users.noreply.github.com>
|
I've updated the cashu-ts implementation to handle Schnorr-derived pubkeys as well. This allows Nostr users to sign P2BK tokens locked with their We should probably document the Schnorr secret key derivation in this NUT, since it’s not as straightforward. For compressed SEC1 keys, the public key includes its Y-parity bit, so the blinded secret key is always derived as For Schnorr, public keys are x-only with enforced even-Y parity, which means the original secret key So when deriving the blinded secret key for a blinded pubkey |
Why didn't this problem emerge in the tests? |
just speculating: maybe the tests do not include this case? if that's true, we should add a case that triggers the need for this behavior |
…k=p+r and k=-p+r); fix normalization to preserve empty tags; clarify key encodings. Resolves -+p issue per PR cashubtc#291 discussion.
…rmalization must preserve tags: [].}
It did. I added tests for Schnorr derived keys when I found out P2BK wasn't consistently working with Nostr secret keys. Then I fixed it :) |
And just to be clear, there was never an issue signing regular Schnorr pubkey locked proofs. It was just for P2BK where we have to derive an sk for a blinded Schnorr derived pubkey. |
Yes that's clear. |
Co-authored-by: Rob Woodgate <robwoodgate@users.noreply.github.com>
Co-authored-by: Rob Woodgate <robwoodgate@users.noreply.github.com>
|
I've added Cashu-TS with P2BK support ( TS files for these tools available here. |
|
Some topics that were discussed off-proposal:
|
|
Have updated the reference implementation for cashu-ts to the agreed new format.
Cashu NutLock and related Nostrly Cashu tools have also been updated to use this latest version. Here is a sample P2BK token created with NutLock: |
robwoodgate
left a comment
There was a problem hiding this comment.
Great work @lollerfirst, you've captured everything really well.
I've added a couple of suggestions for absolute clarity, but this is looking great.
Co-authored-by: Rob Woodgate <robwoodgate@users.noreply.github.com>
Co-authored-by: Rob Woodgate <robwoodgate@users.noreply.github.com>
Co-authored-by: Rob Woodgate <robwoodgate@users.noreply.github.com>
Co-authored-by: Rob Woodgate <robwoodgate@users.noreply.github.com>
robwoodgate
left a comment
There was a problem hiding this comment.
Couple more suggestions
|
Re: c63aa7f extending NUT10Options. In Cashu-TS, I did a NUT-26 flag at the top level... as https://github.com/robwoodgate/cashu-ts/blob/v3-hackday/src/model/PaymentRequest.ts It probably doesn't matter much either way, but as blinding is specifically a P2PK related concept, perhaps it should not be part of the generic NUT-10 options? |
Maybe you're right. |
|
NACK - I've been thinking about this, and am uneasy that the So I've proposed an alternative blinding scheme, based on ECDH shared secrets. |
|
Closing in favor of ECDH derived blinding factors |
Closes #290
This PR lays out rules for blinding locking keys in secrets with p2pk locking conditions.
Implementation only requires client side (wallet) additional logic.