z-classic / z-nomp

z-nomp is mining pool software for Zcash and Zclassic so you can create internet money in your home!
MIT License
291 stars 437 forks source link

What does diff means? #389

Open pavlovdog opened 5 years ago

pavlovdog commented 5 years ago

I've never seen this question been answered anywhere, so let be the first. Most likely it's pretty simple, so can you give some detailed explanation for the whole ports section:

    "ports": {
        "3036": {
            "tls":false,
            "diff": 7.5,
            "varDiff": {
                "minDiff": 0.04,
                "maxDiff": 16,
                "targetTime": 60,
                "retargetTime": 80,
                "variancePercent": 30
            }
        }

I can't understand why need to specify the difficulty in the configuration - it's one for all the network.

igorvoltaic commented 5 years ago

Hi, That’s share difficulty for miners, not network difficultly.

pavlovdog commented 5 years ago

@igorvoltaic can you explain how does this feature works? In my understanding, the pool just needs to create some kind of block template with an unknown nonce. And after that, it starts sharing this templates with the miners, setting up the different nonce range. Easy to see, that in this case, the difficulty is the same for all miners.

igorvoltaic commented 5 years ago

@pavlovdog well.. i'm not really into this. What i know is that almost every pool lets you set difficulty for your shares. But usually pool itself decides which difficulty is the best for you, according to your hash rate. Higher difficulty means it takes longer for your mining software to generate a share, but on the other hand that share has more value in this case. it has nothing to do with the network difficulty.

interbiznw commented 5 years ago

You set different ports with different difficulties for miners to choose from. They generally pick what diff port is closest to the diff their rigs run best at. A pool op can also set variable diff on the ports so it connects at the static diff and adjusts every x amount of seconds based off the retargetTime

pavlovdog commented 5 years ago

@interbiznw Thanks for your answer! Am I right, that the diff value is always between 0 and current network difficulty / 8192?