0

For some reason, I am require to store the hash to database. I would like to know is there any criteria to determine that the hash is finalize?

For example, Block #15000000 have hash value of 0x9a71a95be3fe957457b11817587e5af4c7e24836d5b383c430ff25b9286a457f

How to ensure the hash value for that particular block is finalize and no more change after that especially the first few latest block? Is there any mathematical formula to determine these?

Reference: https://etherscan.io/block/15000000

1 Answer 1

1

Oversimplified answer: don't worry if you don't take the last few block you'll be fine


True answer:

The hash of a block is the hash of the elements of the block. So a hash is always finalized in the sense that the hash represents one specific block.

Maybe you mean to say, how do we know that the block at height 15000000 will not change? For that question, you need to look into the fork choice rule of Ethereum which dictates the canonical chain if there are concurrent chains. In simple terms, it means: if we have different blocks at the same height which one do we choose?

The fork choice rule of Ethereum is GHOST so basically, the block chosen is the one on the 'heaviest chain' (it is a little more involved than that in reality).

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.