user63278: On the Stratum protocol the server may issue the following notification:
{ "id": null, "method": "mining.set_difficulty", "params": [2]}

What is this difficulty used for? from my understanding the the difficulty is sent with the mining job as an encoded difficulty.
Source:
https://slushpool.com/help/manual/stratum-protocol

user24925: The command is telling the miner not to send shares below the requested difficulty. If they were to send every difficulty 1 share for example, many pieces of hardware would be attempting to send hundreds of thousands of results a second. It’s simply flood control, and the only reason to send block shares at all (that are too low of a difficulty to be a block) is to prove to the remote stratum server that you’re doing work worth paying. 
Many pools clamp at a lower bound of many tens of thousands of difficulty as of 2017, and many pieces of hardware aren’t even able to produce blocks with a lower difficulty than that. The miner really only needs to send share proofs every few minutes at most for the remote pool to have a reasonable confidence that they are mining at a particular speed for payout purposes. 

63278: <p>On the Stratum protocol the server may issue the following notification:</p>

<pre><code>{ "id": null, "method": "mining.set_difficulty", "params": [2]}
</code></pre>

<p>What is this difficulty used for? from my understanding the the difficulty is sent with the mining job as an encoded difficulty.</p>

<p>Source:
<a href="https://slushpool.com/help/manual/stratum-protocol" rel="nofollow noreferrer">https://slushpool.com/help/manual/stratum-protocol</a></p>
 24925: <p>The command is telling the miner not to send shares below the requested difficulty. If they were to send every difficulty 1 share for example, many pieces of hardware would be attempting to send hundreds of thousands of results a second. It’s simply flood control, and the only reason to send block shares at all (that are too low of a difficulty to be a block) is to prove to the remote stratum server that you’re doing work worth paying. </p>

<p>Many pools clamp at a lower bound of many tens of thousands of difficulty as of 2017, and many pieces of hardware aren’t even able to produce blocks with a lower difficulty than that. The miner really only needs to send share proofs every few minutes at most for the remote pool to have a reasonable confidence that they are mining at a particular speed for payout purposes. </p>
