What is pool hopping? What is pool hopping and how do pool hoppers affect other miners?

Are there ways to prevent it?
Some mining pools have a reward method for which some times are better to mine than others; normally, miners contribute to the pool equally through good and bad times, and their reward averages out to what is statistically expected.

Pool-hopping is the practice of mining in a pool only during the good times, and leaving during the bad times; by so doing, a pool-hopper can get more out of the pool than the value they contribute to it, increasing their rewards at the expense of other miners. Pool-hopping gets its name from the act of constantly hopping into and out of the pool (to either other pools or solo mining).

The most well-known form of pool-hopping is with pools using the proportional method, which is among the oldest, simplest, most widely used and most prone to hopping. By all accounts hopping in this context was first discussed in a paper from January 2011 by Nakamoto Ryo; a more accurate analysis was given shortly after in Optimal pool abuse strategy by Raulo; these results were extended in Analysis of Bitcoin Pooled Mining Reward Systems by myself.

In the proportional method, a block's reward is distributed between miners in proportion to the number of shares each of them submitted since the previous block; the reward per share is the block reward divided by the number of shares in the round. Because of this, the reward of a share submitted at any given time is affected by the number of shares already submitted since the last block; a share submitted early in the round will have a higher reward on average than a share submitted later.

It can be shown that until the number of shares in the round is 43.5% of the difficulty, a submitted share will have higher than normal reward on average; the optimal way to exploit a single proportional pool is to mine in it until this point is reached, hop to a different pool, and return when a block is found. The gain that can be achieved by following this strategy is up to 28.1%, depending on the ratio between the hashrates of hoppers and continuous miners in this pool (the more hoppers, the less they will gain). The gain can be higher if more than one proportional pool is taken advantage of (for example, 51.6% can be achieved with 2 pools).

The extra profits of hoppers come at the expense of the continuous miners. The exact loss depends on the ratio between hoppers and continuous miners; when they are equal the loss is about 17.1%, and the theoretical limit when there are only hoppers is 43.5%.

Slush's method, which scores shares based on the time they are submitted, was designed to combat pool-hopping, but is only an incomplete solution. SMPPS which strives to converge to the full value of each share in the long run can only be hopped to minimize the time until being paid in full, not to increase the expected reward.

Modern methods make sure that the reward per share depends only on the future of the pool, not its past. This way, without being able to divine future random events, any time is as good as any other to mine, so there can never be any gain or loss from hopping (with the exception of block-withholding attacks). The most popular such methods are PPS, PPLNS and DGM.

Advanced forms of pool-hopping, possible in some naive reward method implementations, include difficulty retarget hopping, tx fee hopping and hashrate fluctuation hopping.