I'm developing a miner to study how mining works and I've connected it to a pool using Stratum. When I use the bits provided by the pool to calculate the target, it is different from the miner that I use (cpuminer). The target from cpuminer is easier than mine, like, the cpuminer target has 4 leading zeroes and mine has like 13 leading zeroes. I also noticed that the pool sends the difficulty, but I have no idea how should I use it.
How should I use the difficulty provided by the pool to calculate my target?
Edit: I've set it up to get difficulty 8 only.
cpuminer target: 00002000 00000000 00000000 00000000 ffffffff ffffffff ffffffff ffffffff
my target : 00000000 0071c175 00000000 00000000 00000000 00000000 00000000 00000000