1

In PoW algorithm a miner has to solve a mathematical puzzle whose difficulty depends upon load on network and total computing power. But who decides what would be that puzzle for each block? For Example I am mining a block and I have to solve following equation A + B = C now I have A and I have to find B to solve this equation but who in blockchain network provides C (predetermined number) for each block ? Or How do the other miners verify that he really did find the winning hash?

1

a miner has to solve a mathematical puzzle

Let's be specific: a miner has to find a block header (which you construct with the block content, i.e. transactions) whose hash (double sha256) is a number inferior to the target.

But who decides what would be that puzzle for each block ?

This can be rephrased as: But who decide of the value of the target for each block ?

Short and abstract answer: The network sets the target value.

Or How do the other miners verify that he really did find the winning hash?

Not only the other miners but all the participants of the network (full nodes) verify the PoW upon receiving a block, with "verifying the PoW" meaning "check that the hash (double sha256) of the block header represents a number below the current target.

So, how all the nodes can agree on the validity of the block ? Or, how all nodes can share the same target ?

The target is hardcoded for the genesis block and is adjusted (the higher the target, the lesser the difficulty. The lesser the target, the higher the difficulty) every 2016 blocks. Since all participants share the same block chain and the same formula for adjusting the target, they share the same current target. And since they share the same current target, they accept the same blocks and hence share the same block chain :-).

| improve this answer | |
  • "The network sets the target value". But the network is collection of nodes. So which node decides target for current Block ? Or if they do it collectively what is the mechanism ? – Rizstien Dec 24 '19 at 9:25
  • 1
    I began with this abstraction in my answer to then answer precisely your comment. The target is updated individually at a fixed interval by each node, since the same algorithm and the same interval is used they collectively share the same value for the target. – darosior Dec 24 '19 at 21:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.