Who decides whether a submitted share leads to a valid block or not?

2

If a share does not lead to a valid block they would not require to be sent to the server? Or is the only purpose of the share sent to the server to show that the client did some work?

user2084795

Posted 2013-03-25T10:15:18.460

Reputation: 247

Answers

1

No person decides. This block of C++ code decides:

bool CheckProofOfWork(uint256 hash, unsigned int nBits)
{
    CBigNum bnTarget;
    bnTarget.SetCompact(nBits);

    // Check range
    if (bnTarget <= 0 || bnTarget > bnProofOfWorkLimit)
        return error("CheckProofOfWork() : nBits below minimum work");

    // Check proof of work matches claimed amount
    if (hash > bnTarget.getuint256())
        return error("CheckProofOfWork() : hash doesn't match nBits");

    return true;
}

For people who can't read C++: It looks at the target hash field, then unpacks it, and compares it to the actual hash.

Nick ODell

Posted 2013-03-25T10:15:18.460

Reputation: 26 536

where did you get that piece of code from?user2084795 2013-03-30T16:06:53.507

@user2084795 main.cpp line 1155

Nick ODell 2013-03-30T17:32:21.367

1

Yes, shares are there to provide to the pool operator that you are working with the pool. Because you are actually hashing data and providing valid hashes of the data the pool sent, it proves you are working with them, meaning you deserve some of the sweet BTC reward when someone finds the actual answer.

KDecker

Posted 2013-03-25T10:15:18.460

Reputation: 471