# Mining/PPLNS

PPLNS is the payment system used by MrPlow and many other pool softwares for pooled mining.

PPLNS stands for Pay Per Last N Shares. N is a number of block equivalents to look back. In PPLNS the pool considers shares submitted over the last N blocks of share. That is a bit hard to follow so lets do a concrete example.

Let's suppose the the network difficulty is 40 to solve a block. That means on average, 2^40 hash operations need to be checked to find a block. Workers attached to the pool are mining at difficulty 22 to start with.

This means, that for the current network difficulty of 40 and user shares of 22, we expect there to be 2^(40-22) = 2^18 shares per block (on average).

This means, with a N of 5, the pool will look back 5*2^18 shares and pay those miners for a block in proportion to their number of shares in that set.

So if you mine a share in this example, until the pool sees 5*2^18 more shares, submitted to the pool, the pool will pay you a little for each block found. Of course that could be zero blocks or 10 blocks but on average it should be about 5.

Of course, there is a complication that users mine at higher difficulties if they are faster. So if a miner submits a share at difficulty 20 rather than 22, it is counted as 2^(22-20) = 2^2 = 4 shares. This is reflected in the MrPlow logs:

INFO: Share recorded for snowtest:xx5d2a5c6apvvt4gx553qfch3y2jwjl2q68mc4e5 - (8 shares) (524288 hashes)

In this case, the starting share difficulty is 16 and this work unit was submitted with difficulty 19, thus 2^3 shares.