Open defuse opened 9 years ago
Is there even any benefit to limiting the maximum selector? Why force the prover to re-create all of that memory when they could just keep searching?
Same for the buckets not filling up. Just keep going, being sure to handle overflowing integers properly.
My original rationale was that giving the the prover more selector space to work with would let them brute-force for better selections easier, but that might not actually be a problem.
The maximum selector limit is crucial for security. Imagine there were no limit. Then the following attack would be possible:
The maximum selector limit prevents this attack by ensuring that, while the 4-tuple found in step 2 solves the PoW, it's extremely unlikely to be one of the "valid" solutions allowed by the maximum limit. The space of all 4-tuples is vastly larger than the image of the selectors under the hash function that any solution found a priori to the selector hash is unlikely to be valid.
The upper limit on the index for filling the buckets is important for DoS protection, too. Suppose there were no limit, then the following attack would be possible:
The verifier will stop when it finds the first invalid preimage, but the prover could select the four buckets with the highest lowest [sic] preimage. How bad could the prover make it for the client? Assume the prover doesn't care if the proof checks out, and just wants to DoS the verifier. Assume the prover is also computationally more powerful than the client: They can iterate the extra nonce in order to find "extra-hard-to-verify" solutions. This makes sense, because the prover would build one very-hard-to-verify puzzle solution, and then send it a million times to carry out all of their DoS attacks (it could even be produced by a public effort once, and then re-used by millions of attackers).
We've established that the extra nonce is necessary in order for each puzzle to have a solution, otherwise we admit attacks. The next steps are to:
This is intimately related to #5.
The prover could in-parallel run the work algorithm on two different extra nonces simultaneously, possibly finding a solution faster?