How does the node system understand which ledger is the latest before updating their own ledger?

3

I have two specific questions:

How does a new user realizes which is the correct copy of the ledger to be used when initially updating(downloading) the ledger, and why is it that a user cannot deceive it by broadcasting its ledgers manytimes. (there by giving the system a pseudo idea that that is indeed the majority ledger)

How does one understand if the two ledgers are the same? Does the hash function change with the last transaction? My specific doubt would be that considering that the hash will change with the guesses too even if the last block info is the same then how does the system realize that these are from the same block even if their final values are diff.

Utsav Mitrakaushi Basak

Posted 2016-11-11T21:49:36.570

Reputation: 53

Answers

5

How does a new user realizes which is the correct copy of the ledger to be used when initially updating(downloading) the ledger

They find the highest-work valid blockchain. This is not the same thing as the most popular blockchain - if 999 nodes tell your node they're on a chain, but one node tells you about a longer chain, you will prefer the longer chain.

If you do not see the longer chain at least once, you will not switch to it. However, even if you start mining on the shorter chain, you will switch to a longer chain after it appears.

How does one understand if the two ledgers are the same?

You compare the block hash of the chain tip. If they are equal, both nodes have identical blockchains. If they are not equal, the nodes have different blockchains.

Nick ODell

Posted 2016-11-11T21:49:36.570

Reputation: 26 536