2

when a miner solves a block it gets sent out to the network, when other nodes receive it, how do they verify that the block received was indeed solved and can be added to the blockchain.

So you don't know what the answer is but if you got the answer you know what the question was.

3 Answers 3

2

StephenM wrote a good answer to that:

  1. The difficulty (or nBits as it is called in the code) is shorthand for how difficult it is to solve the block. Essentially, it encodes a target value, and the hash of the block (when treated as a 256 bit integer) must be below that target value to be considered solved.
1

The other nodes can verify it by hashing the block using the supposed solution nonce, and if it returns the same hash as the solution, and it meets the difficulty restrictions (correct number of zeroes at the beginning), the that block is confirmed as solved.

-1

Let's say block #396716 has been just mined. The participants verify:

  1. Is the block really next? Simply look if the previous block is already accepted. Each block contains the ID of previous block.

  2. Has miner performed enough work? Because difficulty is now 120 this means there should be 120÷8 = 15 zeroes in the block ID.

00000000000000000277e25b11ccc9dc44a8563de315c454507522dae5a0d204

000000000000000 <- 15 zeroes. Therefore miner spent enough work.

  1. Is the timestamp correct? Just test if it's near current time.
  2. Verify all transactions inside the block. This includes checking if miner sent himself the correct reward (currently 25 BTC). Next, all transactions are checked, if amounts match, signatures correct, etc..
1
  • That's not how difficulty works. It's not expressed as a number of zeroes at the start, but as a ratio between the maximum block hash and the actually required one. Commented Feb 8, 2016 at 12:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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