nos2x-fox icon indicating copy to clipboard operation
nos2x-fox copied to clipboard

Throw error when event pubkey does not match

Open rossbates opened this issue 1 year ago • 0 comments

Curious to learn what the expected behavior here is. In my client I'm generating an unsigned event with the id and pubkey populated and then using window.nostr.signEvent().

When the nos2x-fox keypair matches the event pubkey everything works great. During testing I added a second profile to test failure states in the UI, to my surprise the extension modified the event with a new id and pubkey and generated a valid sig.

I can deal with this client side by comparing window.nostr.getPublicKey() to the event pubkey, but this was surprising that the extension would change the pubkey instead of throwing an error.

If someone were using multiple profiles on a web client it seems like they could accidentally publish content under the wrong username without warning.

rossbates avatar Aug 11 '24 20:08 rossbates