doesn't proof of work verification necessary involve testing all numbers in the gap? Even using a sieve, wouldn't it become too slow?
Hey Gatra,
yes, proof of work verification involves testing all numbers in the gap.
It is a simple gmp call:
130 /* start has to be a prime */
131 if (!mpz_probab_prime_p(mpz_start, 25)) {
132
133 mpz_clear(mpz_start);
134 return false;
135 }
136
137 mpz_init(mpz_end);
138 mpz_nextprime(mpz_end, mpz_start);
The time for one verification is currently about 0.008 seconds (on a Intel i5-2500K)
If merit is about gap size/log(p), but max gap size is O(log^2(p)), then max merit is O(log(p)). So in order to get more merit, you'll eventually need larger primes, otherwise you'll have an upper bound for the merit! How do you handle this?
This is no problem, you can control the prime bit size with the shift field within the block header.
The largest prime can theoretically have a bit size of 256 + 2^16
Gapcoin also has a (compile time) opt-in restriction for the max allowed shift amount.
The main nodes currently only allows shifts up to 512.
Best regards, j0nn9