sandwichfarm / notemine

⛏️ wasm nostr note miner written in rust.
https://sandwichfarm.github.io/notemine
3 stars 2 forks source link

Add deterministic option #10

Open dskvr opened 2 months ago

dskvr commented 2 months ago

Right now the miner is deterministic. You can take the note, start from zero and get the same work at the same nonce.

This should be optional. When not deterministic, created_at is refreshed on each nonce as suggested by NIP-13.

plebhash commented 1 month ago

does it still make sense to report best nonce, best PoW and best hash when running in non-deterministic mode?

dskvr commented 1 month ago

Maybe not, can add an option to turn that off as well.

In response to your original comment:

I don't disagree, but if nonce is reset on each created_at then nonce will always be somewhere between 1-10. I prefer deterministic hashing myself, but for long hashing operations it does make sense to refresh created_at

plebhash commented 1 month ago

I deleted my previous comment because I realized it doesn't make sense, sorry for the confusion

there's no need to reset the nonce, the probabilities remain the same, even if there's multiple workers

the created_at field can be regularly updated without resetting the nonce and there's no penalties to the search space