Indeed if PPLNS can be abused by pool hoppers I certainly need to do some research and switch to a better reward system. After all, stopping pool hoppers was the reason I went with PPLNS.
Could you please point me to some evidence or explanation of these facts so I can do my research properly? Or perhaps you can explain how it works yourself.
Within a difficulty "set" PPLNS can't be hopped. When difficulty changes if the change is very large (30%+) there is a small window where the pool could be hopped in theory. However there are two real world issues that make this useless:
a) difficulty changes only occur once every 14 days
b) the window isn't always present and last only till block is solved at most
When I pool hopped I had some PPLNS pools setup in my config. The software never found a viable hop point. Even on difficulty changes the PPLNS pools were either <100% efficiency or when they did present a "bonus" other pools were worth even more.
To "solve" even this small (and mostly academic flaw) a PPLNS pool could record the difficulty of each share submitted. The split would then be weighted by difficulty.
1) look at all shares in last N
2) multiply each share by difficulty when submitted
3) take product of number of shares * difficulty
4) total is miner's weighted share count
5) do the same for whole pool
6) miner share = (miner's weighted share count) / (pool's weighted share count)
You could normalize the numbers by dividing difficulty by difficulty of first share. This has no effect on the math it simply makes the numbers smaller and more easily understood.
For example:
In last 2 million shares
you submitted 100,000 shares at difficulty of 1,378,309 worth 1.000 shares each.
you submitted 80,000 shares at difficulty of 1,202,890 worth 0.873 shares each.
Total weighted shares submitted: 169,818.31 shares