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-13: Proof of Work #3

Merged
merged 2 commits into from
May 7, 2022
Merged

NIP-13: Proof of Work #3

merged 2 commits into from
May 7, 2022

Conversation

jb55
Copy link
Contributor

@jb55 jb55 commented May 5, 2022

Proof of work for nostr events! I also fixed some other minor readme stuff.

@jb55 jb55 force-pushed the pow branch 2 times, most recently from 6be1ba8 to ba01cc1 Compare May 5, 2022 17:52
@jb55
Copy link
Contributor Author

jb55 commented May 5, 2022

Harding made a good point about committing to difficulty

Alice won't look at a Nostr message unless it has 30 bits PoW. Bob will look at 29 bits. Without commitments, Carol can target 29 bits for her message to always be seen by Bob and 50% of the time be seen by Alice. With targets, Alice gets her wish and never sees Carol's msgs.

Will update the nip with this recommendation. Perhaps it can be a third entry in the nonce tag?

@cameri
Copy link
Member

cameri commented May 5, 2022

@jb55 I like Hardings' example. We should probably include it.

Signed-off-by: William Casarin <[email protected]>
@jb55
Copy link
Contributor Author

jb55 commented May 6, 2022

how's this:

The third entry to the nonce tag SHOULD contain the target difficulty. This allows clients to protect against situations where bulk spammers targeting a lower difficulty get lucky and match a higher difficulty. For example, if you require 40 bits to reply to your thread and see a committed target of 30, you can safely reject it even if the note has 40 bits difficulty. Without a committed target difficulty you could not reject it. Committing to a target difficulty is something all honest miners should be ok with, and clients MAY reject a note matching a target difficulty if it is missing a difficulty commitment.

Thanks-to: Cameri and scsibug for the initial idea of using the id for PoW
Thanks-to: David A. Harding for the difficulty commitment idea
Signed-off-by: William Casarin <[email protected]>
@fiatjaf fiatjaf merged commit d7a4aad into nostr-protocol:master May 7, 2022
Comment on lines +90 to +93
Delegated Proof of Work
-----------------------

Since the `NIP-01` note id does not commit to any signature, PoW can be outsourced to PoW providers, perhaps for a fee. This provides a way for clients to get their messages out to PoW restricted relays without having to do any work themselves, which is useful for energy constrained devices like on mobile
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section here was inspiration for https://oak-node.net/pow :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is cool 👍 amazing work

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.

4 participants