0

I am seeing this portal

https://anders.com/blockchain/block.html

When i type some data hash changes and when i click on mine button, hash changes again. I guess hash after mine is final one. Whats the logic for mine hash?

2 Answers 2

1

The act of mining is generating a random nonce to try to get the hash below a certain number. So when you change data in the "Data" field, it just changes the hash to whatever the hash of the block number/nonce/data is. Then when you click "Mine", it's changing the nonce field until it finds one that comes with a hash below a certain number.

1
  • So you mean to say, the earlier hash was just a hash of block id and nounce and data. When i clicked on mine, it changed the nounce to solve the puzzle right?
    – Hacker
    May 14, 2018 at 11:57
0

As far as I can understand, the form contains three editable fields: Block, Nonce, Data; and one non-editable field Hash. Hash field always contains hash of the values of three editable fields combined together. So, value of Hash field changes every time any of the values in editable fields change.

Button Mine try to find Nonce value that will make hash low, i.e. such a value that, combined with values in two other editable fields, will make hash to start with at least four hexadecimal zeros. Once such Nonce value is found, is it placed into Nonce field. As long as Mine button updates value of Nonce field, it triggers hash recalculation and thus value in Hash field changes as well.

Background color of the form tells whether current hash is low enough (green background) or not (red background).

Your Answer

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

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